def get_values_from_endpoint(resource, endpoint_params):
    """Determine if any values in the endpoint parameters
    should be used to populate fields.

    An example of this would be resources which don't
    provide their own ID in the return data, and it must
    therefore come from the endpoint used to access the resource.
    In which case, you may define the resource's ID field as::

        id = fields.Integer(from_endpoint='id')

    Args:

        resource (:class:`repose.resources.Resource`):
            The class of the resource being populated
        endpoint_params (dict): All parameters available for formatting
            to the endpoint strings.

    """
    values = {}
    for k, v in resource._fields.items():
        field = v.options.get('from_endpoint')
        if field:
            values[field] = endpoint_params[field]
    return values