@classmethod
def determine_rest_verb(cls, http_method, pk):
    """ Return the REST operation associated with the given HTTP method.

        This is part of the `RestEndpoint` class because this way it becomes
        customisable by subclasses.

        :param str|unicode http_method:
            The HTTP method used for the request.
        :param str|int pk:
            The primary key extracted from the URL template.
        :return str|unicode:
            The REST verb associated with that request. This is also the name
            of the method on `RestResource` that will be called by the endpoint.
        """
    if http_method == 'GET':
        return 'query' if not pk else 'get'
    elif http_method == 'POST' and not pk:
        return 'create'
    elif http_method == 'PUT' and pk:
        return 'update'
    elif http_method == 'DELETE' and pk:
        return 'delete'
    elif http_method == 'OPTIONS':
        return 'options'
    elif http_method == 'HEAD':
        return 'head'
    else:
        return None
