'Get a list of sprint GreenHopperResources.
:param board_id: the board to get sprints from
:param extended: Used only by old GreenHopper API to fetch additional information like
startDate, endDate, completeDate, much slower because it requires an additional requests for each sprint.
New JIRA Agile API always returns this information without a need for additional requests.
:param startAt: the index of the first sprint to return (0 based)
:param maxResults: the maximum number of sprints to return
:param state: Filters results to sprints in specified states. Valid values: future, active, closed.
You can define multiple states separated by commas
:rtype: dict
:return: (content depends on API version, but always contains id, name, state, startDate and endDate)
When old GreenHopper private API is used, paging is not enabled,
and `startAt`, `maxResults` and `state` parameters are ignored.'

@translate_resource_args
def sprints(self, board_id, extended=False, startAt=0, maxResults=50, state=None):

    params = {}
    if state:
        if isinstance(state, string_types):
            state = state.split(u',')
        params[u'state'] = state
    if (self._options[u'agile_rest_path'] == GreenHopperResource.GREENHOPPER_REST_PATH):
        r_json = self._get_json((u'sprintquery/%s?includeHistoricSprints=true&includeFutureSprints=true' % board_id), base=self.AGILE_BASE_URL)
        if params:
            warnings.warn((u'Old    private    GreenHopper    API    is    used,    parameters    %s    will    be    ignored.' % params), Warning)
        if extended:
            sprints = [Sprint(self._options, self._session, self.sprint_info(None, raw_sprints_json[u'id'])) for raw_sprints_json in r_json[u'sprints']]
        else:
            sprints = [Sprint(self._options, self._session, raw_sprints_json) for raw_sprints_json in r_json[u'sprints']]
        return ResultList(sprints, 0, len(sprints), len(sprints), True)
    else:
        return self._fetch_pages(Sprint, u'values', (u'board/%s/sprint' % board_id), startAt, maxResults, params, self.AGILE_BASE_URL)
