# Path: sakuraio/software/exceptions.py
# class UnSupportedExceptions(SakuraIOClientBaseExceptions):
#     def __init__(self, type, value):
#         self.type = type
#         self.value = value
# 
#     def __str__(self):
#         return '[ERROR] {0} is unsupported {1} option.'.format(self.value, self.type)
# 
# Path: sakuraio/software/utils.py
# def validate_sort_project(value):
#     sort_options = [None, '', 'name', 'id', '-name', '-id']
#     if value not in sort_options:
#         return False
# 
#     return True
# 
# def validate_datastore(value):
#     datastore_options = ['light', 'standard']
#     if value not in datastore_options:
#         return False
# 
#     return True
# 
# def validate_location(value):
#     location_options = ['false', 'true']
#     if value not in location_options:
#         return False
# 
#     return True


from sakuraio.software.exceptions import UnSupportedExceptions
from sakuraio.software.utils import validate_sort_project, validate_datastore, validate_location


class ProjectMixins(object):
    def show_projects(self, name=None, sort=None):
        # validate sort option
        if not validate_sort_project(sort):
            raise UnSupportedExceptions('sort', sort)

        return self.do('GET', 'projects',
                       query_params={'name': name, 'sort': sort}
                       )

    def create_project(self, name, datastore='light', location='false'):

# Path: sakuraio/software/exceptions.py
# class UnSupportedExceptions(SakuraIOClientBaseExceptions):
#     def __init__(self, type, value):
#         self.type = type
#         self.value = value
# 
#     def __str__(self):
#         return '[ERROR] {0} is unsupported {1} option.'.format(self.value, self.type)
# 
# Path: sakuraio/software/utils.py
# def validate_sort_project(value):
#     sort_options = [None, '', 'name', 'id', '-name', '-id']
#     if value not in sort_options:
#         return False
# 
#     return True
# 
# def validate_datastore(value):
#     datastore_options = ['light', 'standard']
#     if value not in datastore_options:
#         return False
# 
#     return True
# 
# def validate_location(value):
#     location_options = ['false', 'true']
#     if value not in location_options:
#         return False
# 
#     return True


# Path: sakuraio/software/apis/project.py
from sakuraio.software.exceptions import UnSupportedExceptions
from sakuraio.software.utils import validate_sort_project, validate_datastore, validate_location



class ProjectMixins(object):
    def show_projects(self, name=None, sort=None):
        # validate sort option
        if not validate_sort_project(sort):
            raise UnSupportedExceptions('sort', sort)

        return self.do('GET', 'projects',
                       query_params={'name': name, 'sort': sort}
                       )

    def create_project(self, name, datastore='light', location='false'):

        if validate_datastore(datastore) is not True: