def create(task)
      validate_type!(task)

      attributes = sanitize(task)
      _, _, root = @client.post("/tasks", attributes)

      Task.new(root[:data])
    end
def create(task)
      validate_type!(task)

      attributes = sanitize(task)
      _, _, root = @client.post("/tasks", attributes)

      Task.new(root[:data])
    end
Create a task

 post '/tasks'

 Creates a new task
 You can create either a **floating** task or create a **related** task and associate it with one of the resource types below:
 * [Leads](/docs/rest/reference/leads)
 * [Contacts](/docs/rest/reference/contacts)
 * [Deals](/docs/rest/reference/deals)

 @param task [Task, Hash] Either object of the Task type or Hash. This object's attributes describe the object to be created.
 @return [Task] The resulting object represting created resource.