def METHOD_NAME(self, validated_data):
    book = validated_data.get('book', None)
    book_format = validated_data.get('book_format', None)
    account_uuid = validated_data.get('account_uuid', None)
    resource_name = validated_data.get('resource_name', None)
    contact_id = validated_data.get('contact_id', None)
    rd = []
    try:
        rd = ResourceDownload.objects.filter(account_uuid=account_uuid, book=book)
        if resource_name:
            rd.filter(resource_name=resource_name)
        rd = rd[0] # we only need the first result - but there might already be duplicates so this should handle that
        rd.contact_id = contact_id
        rd.save()
    except (ResourceDownload.DoesNotExist, IndexError):
        if book:
            rd = ResourceDownload.objects.METHOD_NAME(**validated_data)
    return rd