/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteSnapshotRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) DeleteSnapshotRequest request = new DeleteSnapshotRequest { RequestId = "", Project = "", Snapshot = "", }; // Make the request lro::Operation <Operation, Operation> response = snapshotsClient.Delete(request); // Poll until the returned long-running operation is complete lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Operation result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name lro::Operation <Operation, Operation> retrievedResponse = 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 }
/// <summary>Snippet for SetLabels</summary> public void SetLabels() { // Snippet: SetLabels(string, string, GlobalSetLabelsRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; GlobalSetLabelsRequest globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); // Make the request lro::Operation <Operation, Operation> response = snapshotsClient.SetLabels(project, resource, globalSetLabelsRequestResource); // Poll until the returned long-running operation is complete lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Operation result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name lro::Operation <Operation, Operation> retrievedResponse = 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 }
/// <summary>Snippet for List</summary> public void List() { // Snippet: List(string, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) string project = ""; // Make the request SnapshotList response = snapshotsClient.List(project); // End snippet }
/// <summary>Snippet for GetIamPolicy</summary> public void GetIamPolicy() { // Snippet: GetIamPolicy(string, string, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; // Make the request Policy response = snapshotsClient.GetIamPolicy(project, resource); // End snippet }
/// <summary>Snippet for Delete</summary> public void Delete() { // Snippet: Delete(string, string, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) string project = ""; string snapshot = ""; // Make the request Operation response = snapshotsClient.Delete(project, snapshot); // End snippet }
/// <summary>Snippet for TestIamPermissions</summary> public void TestIamPermissions() { // Snippet: TestIamPermissions(string, string, TestPermissionsRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest(); // Make the request TestPermissionsResponse response = snapshotsClient.TestIamPermissions(project, resource, testPermissionsRequestResource); // End snippet }
/// <summary>Snippet for SetIamPolicy</summary> public void SetIamPolicy() { // Snippet: SetIamPolicy(string, string, GlobalSetPolicyRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) string project = ""; string resource = ""; GlobalSetPolicyRequest globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); // Make the request Policy response = snapshotsClient.SetIamPolicy(project, resource, globalSetPolicyRequestResource); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListSnapshotsRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) ListSnapshotsRequest request = new ListSnapshotsRequest { OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request PagedEnumerable <SnapshotList, Snapshot> response = snapshotsClient.List(request); // Iterate over all response items, lazily performing RPCs as required foreach (Snapshot item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (SnapshotList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Snapshot item in page) { // Do something with each item Console.WriteLine(item); } } // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <Snapshot> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (Snapshot item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
/// <summary>Snippet for Get</summary> public void GetRequestObject() { // Snippet: Get(GetSnapshotRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) GetSnapshotRequest request = new GetSnapshotRequest { Project = "", Snapshot = "", }; // Make the request Snapshot response = snapshotsClient.Get(request); // End snippet }
/// <summary>Snippet for TestIamPermissions</summary> public void TestIamPermissionsRequestObject() { // Snippet: TestIamPermissions(TestIamPermissionsSnapshotRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) TestIamPermissionsSnapshotRequest request = new TestIamPermissionsSnapshotRequest { Resource = "", Project = "", TestPermissionsRequestResource = new TestPermissionsRequest(), }; // Make the request TestPermissionsResponse response = snapshotsClient.TestIamPermissions(request); // End snippet }
/// <summary>Snippet for SetIamPolicy</summary> public void SetIamPolicyRequestObject() { // Snippet: SetIamPolicy(SetIamPolicySnapshotRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) SetIamPolicySnapshotRequest request = new SetIamPolicySnapshotRequest { Resource = "", Project = "", GlobalSetPolicyRequestResource = new GlobalSetPolicyRequest(), }; // Make the request Policy response = snapshotsClient.SetIamPolicy(request); // End snippet }
/// <summary>Snippet for GetIamPolicy</summary> public void GetIamPolicyRequestObject() { // Snippet: GetIamPolicy(GetIamPolicySnapshotRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) GetIamPolicySnapshotRequest request = new GetIamPolicySnapshotRequest { Resource = "", Project = "", OptionsRequestedPolicyVersion = 0, }; // Make the request Policy response = snapshotsClient.GetIamPolicy(request); // End snippet }
/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteSnapshotRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) DeleteSnapshotRequest request = new DeleteSnapshotRequest { RequestId = "", Project = "", Snapshot = "", }; // Make the request Operation response = snapshotsClient.Delete(request); // End snippet }
/// <summary>Snippet for SetLabels</summary> public void SetLabelsRequestObject() { // Snippet: SetLabels(SetLabelsSnapshotRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) SetLabelsSnapshotRequest request = new SetLabelsSnapshotRequest { GlobalSetLabelsRequestResource = new GlobalSetLabelsRequest(), Resource = "", Project = "", }; // Make the request Operation response = snapshotsClient.SetLabels(request); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListSnapshotsRequest, CallSettings) // Create client SnapshotsClient snapshotsClient = SnapshotsClient.Create(); // Initialize request argument(s) ListSnapshotsRequest request = new ListSnapshotsRequest { PageToken = "", MaxResults = 0U, Filter = "", OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request SnapshotList response = snapshotsClient.List(request); // End snippet }