# Path: auth.py
# class Auth:
#     def login_required(*args, **kwargs):
#     def current_user(self):
#     def init_app(app):
# def load_user(user_id):
# def load_user_from_request(request):
# 
# Path: models.py
# class Address(BaseModel):
#     """
#     The model Address represent a user address.
#     Each address is releated to one user, but one user can have
#     more addresses.
# 
#     Attributes:
#         uuid (UUID): Address unique uuid
#         user (:any:`User`): Foreign key pointing to the user `owner` of the address
#         country (str): Country for the address, i.e. ``Italy``
#         city (str): City name
#         post_code (str): Postal code for the address
#         address (str): Full address for the Address resource
#         phone (str): Phone number for the Address
#     """
#     uuid = UUIDField(unique=True)
#     user = ForeignKeyField(User, related_name='addresses')
#     country = CharField()
#     city = CharField()
#     post_code = CharField()
#     address = CharField()
#     phone = CharField()
# 
#     _schema = AddressSchema
# 
# Path: utils.py
# def generate_response(data, status, mimetype='application/vnd.api+json'):
#     """
#     Given a resource model that extends from `BaseModel` generate a Reponse
#     object to be returned from the application endpoints'
#     """
#     return Response(
#         response=data,
#         status=status,
#         mimetype=mimetype
#     )


from auth import auth
from flask import request
from flask_restful import Resource
from http.client import CREATED, NO_CONTENT, NOT_FOUND, OK, BAD_REQUEST
from models import Address
from utils import generate_response
import uuid



class AddressesHandler(Resource):
    """ Addresses endpoint. """
    @auth.login_required
    def get(self):

# Path: auth.py
# class Auth:
#     def login_required(*args, **kwargs):
#     def current_user(self):
#     def init_app(app):
# def load_user(user_id):
# def load_user_from_request(request):
# 
# Path: models.py
# class Address(BaseModel):
#     """
#     The model Address represent a user address.
#     Each address is releated to one user, but one user can have
#     more addresses.
# 
#     Attributes:
#         uuid (UUID): Address unique uuid
#         user (:any:`User`): Foreign key pointing to the user `owner` of the address
#         country (str): Country for the address, i.e. ``Italy``
#         city (str): City name
#         post_code (str): Postal code for the address
#         address (str): Full address for the Address resource
#         phone (str): Phone number for the Address
#     """
#     uuid = UUIDField(unique=True)
#     user = ForeignKeyField(User, related_name='addresses')
#     country = CharField()
#     city = CharField()
#     post_code = CharField()
#     address = CharField()
#     phone = CharField()
# 
#     _schema = AddressSchema
# 
# Path: utils.py
# def generate_response(data, status, mimetype='application/vnd.api+json'):
#     """
#     Given a resource model that extends from `BaseModel` generate a Reponse
#     object to be returned from the application endpoints'
#     """
#     return Response(
#         response=data,
#         status=status,
#         mimetype=mimetype
#     )


# Path: views/address.py
from auth import auth
from flask import request
from flask_restful import Resource
from http.client import CREATED, NO_CONTENT, NOT_FOUND, OK, BAD_REQUEST
from models import Address
from utils import generate_response
import uuid




class AddressesHandler(Resource):
    """ Addresses endpoint. """
    @auth.login_required
    def get(self):

        user_addrs = list(Address.select().where(