Commit 70f6dd3c authored by GromeTT's avatar GromeTT
Browse files

ENH: Typos + completed documentation for thing.py

parent e5bccad3
...@@ -96,10 +96,10 @@ def model(self): ...@@ -96,10 +96,10 @@ def model(self):
@property @property
def features(self): def features(self):
"""Returns """Returns this object's features.
:returns: :returns: Features
:rtype: :rtype: dict
""" """
...@@ -107,7 +107,7 @@ def features(self): ...@@ -107,7 +107,7 @@ def features(self):
@features.setter @features.setter
def features(self, value): def features(self, value):
"""Replaces __features with vale. """Replaces __features with value.
:param value: New collection of features :param value: New collection of features
...@@ -117,21 +117,20 @@ def features(self, value): ...@@ -117,21 +117,20 @@ def features(self, value):
@property @property
def roles(self): def roles(self):
"""Returns the things roles. """Returns the thing's roles.
:returns: ml40 roles :returns: ml40 roles
:rtype: dict :rtype: dict
""" """
return self.__roles return self.__roles
@roles.setter @roles.setter
def roles(self, value): def roles(self, value):
"""Adds a new role. """Replaces __roles with value
:param value: The new role :param value: New collection of roles
:type value: ml.role
""" """
self.__roles = value self.__roles = value
...@@ -141,8 +140,8 @@ def client_secret(self): ...@@ -141,8 +140,8 @@ def client_secret(self):
"""Returns the client secret. """Returns the client secret.
:returns: Client secret :returns: Client secret
:rtype: str :rtype: str
""" """
return self.__client_secret return self.__client_secret
...@@ -153,8 +152,8 @@ def grant_type(self): ...@@ -153,8 +152,8 @@ def grant_type(self):
identity provider. identity provider.
:returns: authentication method :returns: authentication method
:rtype: str :rtype: str
""" """
return self.__grant_type return self.__grant_type
...@@ -165,6 +164,7 @@ def access_token(self): ...@@ -165,6 +164,7 @@ def access_token(self):
:returns: java web token :returns: java web token
:rtype: str :rtype: str
""" """
return self.__access_token return self.__access_token
...@@ -174,6 +174,7 @@ def name(self): ...@@ -174,6 +174,7 @@ def name(self):
:returns: name :returns: name
:rtype: str :rtype: str
""" """
return self.__name return self.__name
...@@ -184,6 +185,7 @@ def thing_id(self): ...@@ -184,6 +185,7 @@ def thing_id(self):
:returns: identifier :returns: identifier
:rtype: str :rtype: str
""" """
return self.__thing_id return self.__thing_id
...@@ -866,10 +868,12 @@ def to_json(self): ...@@ -866,10 +868,12 @@ def to_json(self):
return self.dt_json return self.dt_json
def to_subthing_json(self): def to_subthing_json(self):
""" """Returns a dictionary representing this thing in it's current state
as a subordinate thing. This representation should be used for
subordinate things in s3i repository entries.
:returns: :returns: Representation of this object as a subordinate thing
:rtype: :rtype: dict
""" """
...@@ -887,6 +891,15 @@ def to_subthing_json(self): ...@@ -887,6 +891,15 @@ def to_subthing_json(self):
return json_out return json_out
def to_subthing_dir_json(self): def to_subthing_dir_json(self):
"""Returns a dictionary representing this thing in it's current state
as a subordinate thing. This representation should be used for
subordinate things in s3i directory entries.
:returns: Representation of this object as a subordinate thing.
:rtype: dict
"""
json_out = {"class": "ml40::Thing", "identifier": self.thing_id, "links": []} json_out = {"class": "ml40::Thing", "identifier": self.thing_id, "links": []}
for key in self.roles.keys(): for key in self.roles.keys():
role_entry = {"association": "roles", "target": self.roles[key].to_json()} role_entry = {"association": "roles", "target": self.roles[key].to_json()}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment