def METHOD_NAME(cls, rest_obj: ComputeResource) -> "VirtualMachineCompute":
    prop = rest_obj.properties
    credentials = prop.properties.administrator_account if prop.properties else None
    ssh_settings_param = None
    if credentials or (prop.properties and prop.properties.ssh_port):
        ssh_settings_param = VirtualMachineSshSettings(
            admin_username=credentials.username if credentials else None,
            admin_password=credentials.password if credentials else None,
            ssh_port=prop.properties.ssh_port if prop.properties else None,
        )
    response = VirtualMachineCompute(
        name=rest_obj.name,
        id=rest_obj.id,
        description=prop.description,
        location=rest_obj.location,
        resource_id=prop.resource_id,
        tags=rest_obj.tags if rest_obj.tags else None,
        public_key_data=credentials.public_key_data if credentials else None,
        provisioning_state=prop.provisioning_state,
        provisioning_errors=prop.provisioning_errors[0].error.code
        if (prop.provisioning_errors and len(prop.provisioning_errors) > 0)
        else None,
        ssh_settings=ssh_settings_param,
    )
    return response