Ejemplo n.º 1
0
    def __init__(self, version, payload, account_id, owner_type, owner_id):
        """
        Initialize the ApiKeyInstance

        :returns: connio.rest.api.v3.account.apikey.ApiKeyInstance
        :rtype: connio.rest.api.v3.account.apikey.ApiKeyInstance
        """
        super(ApiKeyInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_id': payload['accountId'],
            'id': payload['id'],
            'secret': payload['secret'],
            'owner_id': payload['ownerId'],
            'context': payload['context'],
            'scope': payload['scope'],
            'rate_limit': payload['rateLimit'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload['dateModified']),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'owner_type': owner_type,
            'owner_id': owner_id or self._properties['owner_id'],
        }
Ejemplo n.º 2
0
    def __init__(self, version, payload, account_id, id=None):
        """
        Initialize the AppInstance

        :returns: connio.rest.api.v3.account.app.AppInstance
        :rtype: connio.rest.api.v3.account.app.AppInstance
        """
        super(AppInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_id': payload['accountId'],
            'id': payload['id'],
            'name': payload['name'],
            'friendly_name': payload['friendlyName'],
            'profile_id': payload['profileId'],
            'description': payload.get('description'),
            'tags': payload.get('tags'),
            'status': payload.get('status') or 'enabled',
            'locked': payload['locked'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload['dateModified']),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'id': id or self._properties['id'],
        }
Ejemplo n.º 3
0
    def __init__(self, version, payload, id=None):
        """
        Initialize the AccountInstance

        :returns: connio.rest.api.v3.account.AccountInstance
        :rtype: connio.rest.api.v3.account.AccountInstance
        """
        super(AccountInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'id':
            payload['id'],
            'name':
            payload['name'],
            'friendly_name':
            payload.get('friendlyName'),
            'status':
            payload['status'],
            'owner_account_id':
            payload.get('ownerId'),
            'locked':
            payload['locked'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_modified':
            deserialize.iso8601_datetime(payload.get('dateModified'))
        }

        # Context
        self._context = None
        self._solution = {
            'id': id or self._properties['id'],
        }
Ejemplo n.º 4
0
    def __init__(self, version, payload, account_id, id=None):
        """
        Initialize the DeviceProfileInstance

        :returns: connio.rest.api.v3.account.deviceprofile.DeviceProfileInstance
        :rtype: connio.rest.api.v3.account.deviceprofile.DeviceProfileInstance
        """
        super(DeviceProfileInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_id': payload['accountId'],
            'id': payload['id'],
            'name': payload['name'],
            'friendly_name': payload['friendlyName'],
            'base_profile_id': payload.get('baseProfileId'),
            'description': payload.get('description'),
            'tags': payload.get('tags'),
            'device_class': payload.get('deviceClass'),
            'vendor_name': payload.get('vendorName'),
            'product_name': payload.get('productName'),
            'image_url': payload.get('imageUrl'),
            'locked': payload['locked'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload['dateModified']),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'id': id or self._properties['id'],
        }
Ejemplo n.º 5
0
    def __init__(self, version, payload, account_id, id=None):
        """
        Initialize the AlertInstance

        :returns: connio.rest.api.v3.account.alert.AlertInstance
        :rtype: connio.rest.api.v3.account.alert.AlertInstance
        """
        super(AlertInstance, self).__init__(version)

        # Marshaled Properties
        self._alerts = {
            'account_id':
            payload['accountId'],
            'id':
            payload['id'],
            'owner_id':
            payload['ownerId'],
            'name':
            payload['name'],
            'friendly_name':
            payload['friendlyName'],
            'description':
            payload.get('description'),
            'tags':
            payload.get('tags'),
            'status':
            payload.setdefault('status', 'enabled'),
            'metric':
            payload['metric'],
            'trigger':
            payload.get('triggerPropId') or payload.get('triggerId'),
            'conditions':
            deserialize.conditions(payload.get('conditions')),
            'notifications':
            deserialize.notifications(payload.get('notifications')),
            'locked':
            payload['locked'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload['dateModified']),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'id': id or self._alerts['id'],
        }
Ejemplo n.º 6
0
    def __init__(self, version, payload, account_id, id=None):
        """
        Initialize the MethodInstance

        :returns: connio.rest.api.v3.account.method.MethodInstance
        :rtype: connio.rest.api.v3.account.method.MethodInstance
        """
        from connio.base import deserialize

        super(MethodInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_id':
            payload['accountId'],
            'id':
            payload['id'],
            'owner_id':
            payload['ownerId'],
            'name':
            payload['name'],
            'friendly_name':
            payload['friendlyName'],
            'qualified_name':
            payload['qualifiedName'],
            'description':
            payload.get('description'),
            'tags':
            payload.get('tags'),
            'access_type':
            payload['access'],
            'method_impl':
            deserialize.methodImplementation(payload.get('methodImpl')),
            'inherited':
            payload['inherited'],
            'locked':
            payload['locked'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload['dateModified']),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'id': id or self._properties['id'],
        }
Ejemplo n.º 7
0
    def __init__(self, version, payload, account_id, id=None):
        """
        Initialize the UserInstance

        :returns: connio.rest.api.v3.account.user.UserInstance
        :rtype: connio.rest.api.v3.account.user.UserInstance
        """
        super(UserInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_id':
            payload['accountId'],
            'id':
            payload['id'],
            'name':
            payload.get('name'),
            'email':
            payload['email'],
            'status':
            payload['status'],
            'role':
            payload['role'],
            'description':
            payload.get('description'),
            'tags':
            payload.get('tags'),
            'locale':
            payload.get('locale'),
            'timezone':
            payload.get('timezone'),
            'prefs':
            payload.get('prefs'),
            'avatarUrl':
            payload.get('avatarUrl'),
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload.get('dateModified')),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'id': id or self._properties['id'],
        }
Ejemplo n.º 8
0
    def __init__(self, version, payload, account_id, id=None):
        """
        Initialize the DeviceInstance

        :returns: connio.rest.api.v3.account.device.DeviceInstance
        :rtype: connio.rest.api.v3.account.device.DeviceInstance
        """
        from connio.base import deserialize

        super(DeviceInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_id': payload['accountId'],
            'id': payload['id'],
            'name': payload['name'],
            'friendly_name': payload['friendlyName'],
            'profile_id': payload['profileId'],
            'apps': payload['apps'],
            'description': payload.get('description'),
            'tags': payload.get('tags'),
            'location': deserialize.location(payload.get('location')),
            'custom_ids': payload.get('customIds'),
            'status': payload['status'],
            'period': payload['period'],
            'annotate_with_location': payload['annotateWithLoc'],
            'annotate_with_meta': payload['annotateWithMeta'],
            'locked': payload['locked'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload['dateModified']),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'id': id or self._properties['id'],
        }
Ejemplo n.º 9
0
    def __init__(self, version, payload, account_id, id=None):
        """
        Initialize the PropertyInstance

        :returns: connio.rest.api.v3.account.property.PropertyInstance
        :rtype: connio.rest.api.v3.account.property.PropertyInstance
        """
        super(PropertyInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_id': payload['accountId'],
            'id': payload['id'],
            'owner_id': payload['ownerId'],
            'name': payload['name'],
            'friendly_name': payload['friendlyName'],
            'qualified_name': payload['qualifiedName'],
            'description': payload.get('description'),
            'tags': payload.get('tags'),
            'data_type': payload['type'],
            'access_type': payload['access'],
            'publish_type': payload['publish'],
            'retention': payload.get('retention'),
            'measurement': deserialize.measurement(payload.get('measurement')),
            'inherited': payload['inherited'],
            'locked': payload['locked'],
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_updated':
            deserialize.iso8601_datetime(payload['dateModified']),
        }

        # Context
        self._context = None
        self._solution = {
            'account_id': account_id,
            'id': id or self._properties['id'],
        }
Ejemplo n.º 10
0
    def __init__(self, version, payload, id=None):
        """
        Initialize the SysUserInstance

        :returns: connio.rest.api.v3.sysuser.SysUserInstance
        :rtype: connio.rest.api.v3.sysuser.SysUserInstance
        """
        super(SysUserInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'id':
            payload['id'],
            'account_id':
            payload['accountId'],
            'email':
            payload['email'],
            'name':
            payload.get('name') or payload.get('fullName'),
            'status':
            payload['status'],
            'role':
            payload['role'],
            'locked':
            payload.get('locked'),
            'date_created':
            deserialize.iso8601_datetime(payload['dateCreated']),
            'date_modified':
            deserialize.iso8601_datetime(payload.get('dateModified'))
        }

        # Context
        self._context = None
        self._solution = {
            'id': id or self._properties['id'],
            'account_id': self._properties['account_id']
        }