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