'Set an endpoint\'s rate limits. The data used for each of the
args should come from Twitter\'s ``x-rate-limit`` headers.
Args:
url (str):
URL of the endpoint being fetched.
limit (int):
Max number of times a user or app can hit the endpoint
before being rate limited.
remaining (int):
Number of times a user or app can access the endpoint
before being rate limited.
reset (int):
Epoch time at which the rate limit window will reset.'

def set_limit(self, url, limit, remaining, reset):

    endpoint = self.url_to_resource(url)
    resource_family = endpoint.split('/')[1]
    try:
        family_rates = self.resources.get(resource_family).get(endpoint)
    except AttributeError:
        self.set_unknown_limit(url, limit, remaining, reset)
        family_rates = self.resources.get(resource_family).get(endpoint)
    family_rates['limit'] = enf_type('limit', int, limit)
    family_rates['remaining'] = enf_type('remaining', int, remaining)
    family_rates['reset'] = enf_type('reset', int, reset)
    return EndpointRateLimit(family_rates['limit'], family_rates['remaining'], family_rates['reset'])
