code: public VirtualMachineCaptureResultInner capture(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
          return captureWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().body();
      }
docs: Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
  
  @param resourceGroupName The name of the resource group.
  @param vmName The name of the virtual machine.
  @param parameters Parameters supplied to the Capture Virtual Machine operation.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @throws CloudException thrown if the request is rejected by server
  @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
  @return the VirtualMachineCaptureResultInner object if successful.