def delete_brand(id):
    service = BrandService()
    result = service.delete(id)
    if not (result is None):
        return response_with_status({"message": result}, 404)
    else:
        return response_with_status({"message": "Brand deleted"}, 204)
def get_brand(id):
    service = BrandService()
    e = service.get(id)
    if e is None:
        return response_with_status({"message": "Brand not found"}, 404)
    else:
        return response_with_status(e.to_dict())
def get_brands():
    service = BrandService()
    list = service.get_collection()
    return response_with_status(list)
def update_brand(id):
    data = request.get_json()
    service = BrandService()
    service.update(id, data)
    return response_with_status({"message": "success"}, 200)
def create_brand():
    data = request.get_json()
    service = BrandService()
    service.create(data)
    return response_with_status({"message": "success"}, 201)