'GET /api/requests/{encoded_request_id}/samples
Displays a collection (list) of sample of a sequencing request.'

@web.expose_api
def index(self, trans, **kwd):

    try:
        request_id = trans.security.decode_id(kwd['request_id'])
    except TypeError:
        trans.response.status = 400
        return ('Malformed    request    id    (    %s    )    specified,    unable    to    decode.' % str(kwd['request_id']))
    try:
        request = trans.sa_session.query(trans.app.model.Request).get(request_id)
    except:
        request = None
    if ((not request) or (not (trans.user_is_admin() or (request.user.id == trans.user.id)))):
        trans.response.status = 400
        return ('Invalid    request    id    (    %s    )    specified.' % str(request_id))
    rval = []
    for sample in request.samples:
        item = sample.to_dict()
        item['url'] = url_for('samples', request_id=trans.security.encode_id(request_id), id=trans.security.encode_id(sample.id))
        item['id'] = trans.security.encode_id(item['id'])
        rval.append(item)
    return rval
