/// <summary>Snippet for AddPublicKey</summary> public void AddPublicKeyRequestObject() { // Snippet: AddPublicKey(AddPublicKeyRequest, CallSettings) // Create client CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create(); // Initialize request argument(s) AddPublicKeyRequest request = new AddPublicKeyRequest { Environment = "", Key = "", }; // Make the request Operation <AddPublicKeyResponse, AddPublicKeyMetadata> response = cloudShellServiceClient.AddPublicKey(request); // Poll until the returned long-running operation is complete Operation <AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result AddPublicKeyResponse result = completedResponse.Result; // Or 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 <AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = cloudShellServiceClient.PollOnceAddPublicKey(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result AddPublicKeyResponse retrievedResult = retrievedResponse.Result; } // End snippet }