# 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)


from sakuraio.software.exceptions import UnSupportedExceptions
class ServiceMixins(object):
    def show_servicetypes(self):
        return self.do('GET', 'servicetypes')

    def show_servicetype(self, servicetype_id):
        return self.do('GET', 'servicetypes/{servicetype_id}',
                       url_params={
                           'servicetype_id': servicetype_id
                           }
                       )

    def show_registered_service(self, servicetype=None, sort=None):
        servicetypes = [
            None, '',
            'websocket',
            'incoming-webhook',
            'outgoing-webhook',
            'mqtt',
            'mqtt.aws-iot'
            'datastore'
            ]

        sort_options = [
            None,
            'name', '-name',
            'token', '-token'
            'id', '-id'
            ]

        if servicetype not in servicetypes:

# 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/apis/service.py
from sakuraio.software.exceptions import UnSupportedExceptions

class ServiceMixins(object):
    def show_servicetypes(self):
        return self.do('GET', 'servicetypes')

    def show_servicetype(self, servicetype_id):
        return self.do('GET', 'servicetypes/{servicetype_id}',
                       url_params={
                           'servicetype_id': servicetype_id
                           }
                       )

    def show_registered_service(self, servicetype=None, sort=None):
        servicetypes = [
            None, '',
            'websocket',
            'incoming-webhook',
            'outgoing-webhook',
            'mqtt',
            'mqtt.aws-iot'
            'datastore'
            ]

        sort_options = [
            None,
            'name', '-name',
            'token', '-token'
            'id', '-id'
            ]

        if servicetype not in servicetypes:

            raise UnSupportedExceptions('servicetype', servicetype)