/// <summary>Snippet for CreateMembershipAsync</summary> public async Task CreateMembershipAsync() { // Snippet: CreateMembershipAsync(string, Membership, string, CallSettings) // Additional: CreateMembershipAsync(string, Membership, string, CancellationToken) // Create client GkeHubMembershipServiceClient gkeHubMembershipServiceClient = await GkeHubMembershipServiceClient.CreateAsync(); // Initialize request argument(s) string parent = ""; Membership resource = new Membership(); string membershipId = ""; // Make the request Operation <Membership, OperationMetadata> response = await gkeHubMembershipServiceClient.CreateMembershipAsync(parent, resource, membershipId); // Poll until the returned long-running operation is complete Operation <Membership, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result Membership result = completedResponse.Result; // Or 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 <Membership, OperationMetadata> retrievedResponse = await gkeHubMembershipServiceClient.PollOnceCreateMembershipAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Membership retrievedResult = retrievedResponse.Result; } // End snippet }