'Create a new sprint for the ``board_id``.
:param name: name of the sprint
:param board_id: the board to add the sprint to'

def create_sprint(self, name, board_id, startDate=None, endDate=None):

    payload = {u'name': name}
    if startDate:
        payload[u'startDate'] = startDate
    if endDate:
        payload[u'endDate'] = endDate
    if (self._options[u'agile_rest_path'] == GreenHopperResource.GREENHOPPER_REST_PATH):
        url = self._get_url((u'sprint/%s' % board_id), base=self.AGILE_BASE_URL)
        r = self._session.post(url)
        raw_issue_json = json_loads(r)
        u'    now    r    contains    something    like:\n                                                {\n                                                                        "id":    742,\n                                                                        "name":    "Sprint    89",\n                                                                        "state":    "FUTURE",\n                                                                        "linkedPagesCount":    0,\n                                                                        "startDate":    "None",\n                                                                        "endDate":    "None",\n                                                                        "completeDate":    "None",\n                                                                        "remoteLinks":    []\n                                                }'
        url = self._get_url((u'sprint/%s' % raw_issue_json[u'id']), base=self.AGILE_BASE_URL)
        r = self._session.put(url, data=json.dumps(payload))
        raw_issue_json = json_loads(r)
    else:
        url = self._get_url(u'sprint', base=self.AGILE_BASE_URL)
        payload[u'originBoardId'] = board_id
        r = self._session.post(url, data=json.dumps(payload))
        raw_issue_json = json_loads(r)
    return Sprint(self._options, self._session, raw=raw_issue_json)
