/// <summary>Snippet for DeleteConnectivityTest</summary> public void DeleteConnectivityTest() { // Snippet: DeleteConnectivityTest(string, CallSettings) // Create client ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.Create(); // Initialize request argument(s) string name = ""; // Make the request Operation <Empty, OperationMetadata> response = reachabilityServiceClient.DeleteConnectivityTest(name); // Poll until the returned long-running operation is complete Operation <Empty, OperationMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Empty result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <Empty, OperationMetadata> retrievedResponse = reachabilityServiceClient.PollOnceDeleteConnectivityTest(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Empty retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for UpdateConnectivityTest</summary> public void UpdateConnectivityTest() { // Snippet: UpdateConnectivityTest(FieldMask, ConnectivityTest, CallSettings) // Create client ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.Create(); // Initialize request argument(s) FieldMask updateMask = new FieldMask(); ConnectivityTest resource = new ConnectivityTest(); // Make the request Operation <ConnectivityTest, OperationMetadata> response = reachabilityServiceClient.UpdateConnectivityTest(updateMask, resource); // Poll until the returned long-running operation is complete Operation <ConnectivityTest, OperationMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result ConnectivityTest result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <ConnectivityTest, OperationMetadata> retrievedResponse = reachabilityServiceClient.PollOnceUpdateConnectivityTest(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result ConnectivityTest retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for GetConnectivityTest</summary> public void GetConnectivityTest() { // Snippet: GetConnectivityTest(string, CallSettings) // Create client ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.Create(); // Initialize request argument(s) string name = ""; // Make the request ConnectivityTest response = reachabilityServiceClient.GetConnectivityTest(name); // End snippet }
/// <summary>Snippet for GetConnectivityTest</summary> public void GetConnectivityTestRequestObject() { // Snippet: GetConnectivityTest(GetConnectivityTestRequest, CallSettings) // Create client ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.Create(); // Initialize request argument(s) GetConnectivityTestRequest request = new GetConnectivityTestRequest { Name = "", }; // Make the request ConnectivityTest response = reachabilityServiceClient.GetConnectivityTest(request); // End snippet }
/// <summary>Snippet for ListConnectivityTests</summary> public void ListConnectivityTestsRequestObject() { // Snippet: ListConnectivityTests(ListConnectivityTestsRequest, CallSettings) // Create client ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.Create(); // Initialize request argument(s) ListConnectivityTestsRequest request = new ListConnectivityTestsRequest { Parent = "", Filter = "", OrderBy = "", }; // Make the request PagedEnumerable <ListConnectivityTestsResponse, ConnectivityTest> response = reachabilityServiceClient.ListConnectivityTests(request); // Iterate over all response items, lazily performing RPCs as required foreach (ConnectivityTest 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 (ListConnectivityTestsResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (ConnectivityTest 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 <ConnectivityTest> 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 (ConnectivityTest 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 }