diff --git a/exabel_data_sdk/client/api/data_classes/entity.py b/exabel_data_sdk/client/api/data_classes/entity.py index 32ef892..8dfcf42 100644 --- a/exabel_data_sdk/client/api/data_classes/entity.py +++ b/exabel_data_sdk/client/api/data_classes/entity.py @@ -30,6 +30,22 @@ def __init__( properties: Mapping[str, Union[str, bool, int, float]], read_only: bool = False, ): + r""" + Create an entity resource in the Data API. + + Args: + name: The resource name of the entity, for example + "entityTypes/entityTypeIdentifier/entities/entityIdentifier" or + "entityTypes/namespace1.entityTypeIdentifier/entities/ + namespace2.entityIdentifier". The namespaces must be empty (being + global) or one of the predetermined namespaces the customer has access + to. If namespace1 is not empty, it must be equal to namespace2. The + entity identifier must match the regex [a-zA-Z][\w-]{0,63}. + display_name: The display name of the entity. + description: One or more paragraphs of text description. + properties: The properties of this entity. + read_only: Whether this resource is read only. + """ self.name = name self.display_name = display_name self.description = description diff --git a/exabel_data_sdk/client/api/data_classes/entity_type.py b/exabel_data_sdk/client/api/data_classes/entity_type.py index 2fb1c21..ee2c25a 100644 --- a/exabel_data_sdk/client/api/data_classes/entity_type.py +++ b/exabel_data_sdk/client/api/data_classes/entity_type.py @@ -24,6 +24,20 @@ def __init__( description: str, read_only: bool = False, ): + r""" + Create an entity type resource in the Data API. + + Args: + name: The resource name of the entity type, for example + "entityTypes/entityTypeIdentifier" or + "entityTypes/namespace.entityTypeIdentifier". The namespace must be + empty (being global) or one of the predetermined namespaces the + customer has access to. The entity type identifier must match the + regex [a-zA-Z][\w-]{0,63}. + display_name: The display name of the entity type. + description: One or more paragraphs of text description. + read_only: Whether this resource is read only. + """ self.name = name self.display_name = display_name self.description = description diff --git a/exabel_data_sdk/client/api/data_classes/paging_result.py b/exabel_data_sdk/client/api/data_classes/paging_result.py index f2075c1..7f223e7 100644 --- a/exabel_data_sdk/client/api/data_classes/paging_result.py +++ b/exabel_data_sdk/client/api/data_classes/paging_result.py @@ -8,12 +8,22 @@ class PagingResult(Generic[TValue]): A sequence of results from the Exabel API that can be be retrieved with paging. Attributes: - results: The results of a single request. - next_page_token: The page token where the list continues. Can be sent to a subsequent query. - total_size: The total number of results, irrespective of paging. + results (list): The results of a single request. + next_page_token (str): The page token where the list continues. Can be sent to a subsequent + query. + total_size (int): The total number of results, irrespective of paging. """ def __init__(self, results: Sequence[TValue], next_page_token: str, total_size: int): + """ + Create a PagingResult. + + Args: + results: The results of a single request. + next_page_token: The page token where the list continues. Can be sent to a subsequent + query. + total_size: The total number of results, irrespective of paging. + """ self.results = results self.next_page_token = next_page_token self.total_size = total_size diff --git a/exabel_data_sdk/client/api/data_classes/relationship.py b/exabel_data_sdk/client/api/data_classes/relationship.py index 0bcfe22..4688583 100644 --- a/exabel_data_sdk/client/api/data_classes/relationship.py +++ b/exabel_data_sdk/client/api/data_classes/relationship.py @@ -9,18 +9,19 @@ class Relationship: A relationship resource in the Data API. Attributes: - relationship_type: The resource name of the relationship type, for example - "relationshipTypes/namespace.relationshipTypeIdentifier". The namespace - must be empty (being global) or one of the predetermined namespaces the - customer has access to. The relationship type identifier must match the - regex [A-Z][A-Z0-9_]{0,63}. - from_entity: The resource name of the start point of the relationship, for example - "entityTypes/ns.type1/entities/ns.entity1". - to_entity: The resource name of the end point of the relationship, for example - "entityTypes/ns.type2/entities/ns.entity2". - description: One or more paragraphs of text description. - properties: The properties of this entity. - read_only: Whether this resource is read only. + relationship_type (str): The resource name of the relationship type, for example + "relationshipTypes/namespace.relationshipTypeIdentifier". The + namespace must be empty (being global) or one of the + predetermined namespaces the customer has access to. The + relationship type identifier must match the regex + [A-Z][A-Z0-9_]{0,63}. + from_entity (str): The resource name of the start point of the relationship, + for example "entityTypes/ns.type1/entities/ns.entity1". + to_entity (str): The resource name of the end point of the relationship, + for example "entityTypes/ns.type2/entities/ns.entity2". + description (str): One or more paragraphs of text description. + properties (dict): The properties of this entity. + read_only (bool): Whether this resource is read only. """ def __init__( @@ -32,6 +33,23 @@ def __init__( properties: Mapping[str, Union[str, bool, int, float]], read_only: bool = False, ): + """ + Create a relationship resource in the Data API. + + Args: + relationship_type: The resource name of the relationship type, for example + "relationshipTypes/namespace.relationshipTypeIdentifier". The + namespace must be empty (being global) or one of the predetermined + namespaces the customer has access to. The relationship type + identifier must match the regex [A-Z][A-Z0-9_]{0,63}. + from_entity: The resource name of the start point of the relationship, for example + "entityTypes/ns.type1/entities/ns.entity1". + to_entity: The resource name of the end point of the relationship, for example + "entityTypes/ns.type2/entities/ns.entity2". + description: One or more paragraphs of text description. + properties: The properties of this entity. + read_only: Whether this resource is read only. + """ self.relationship_type = relationship_type self.from_entity = from_entity self.to_entity = to_entity diff --git a/exabel_data_sdk/client/api/data_classes/relationship_type.py b/exabel_data_sdk/client/api/data_classes/relationship_type.py index b77887b..8201ed2 100644 --- a/exabel_data_sdk/client/api/data_classes/relationship_type.py +++ b/exabel_data_sdk/client/api/data_classes/relationship_type.py @@ -11,14 +11,14 @@ class RelationshipType: A relationship type resource in the Data API. Attributes: - name: The resource name of the relationship type, for example - "relationshipTypes/namespace.relationshipTypeIdentifier". The namespace must be - empty (being global) or one of the predetermined namespaces the customer has - access to. The relationship type identifier must match the regex - [A-Z][A-Z0-9_]{0,63}. - description: One or more paragraphs of text description. - properties: The properties of this entity. - read_only: Whether this resource is read only. + name (str): The resource name of the relationship type, for example + "relationshipTypes/namespace.relationshipTypeIdentifier". The namespace + must be empty (being global) or one of the predetermined namespaces + the customer has access to. The relationship type identifier must + match the regex [A-Z][A-Z0-9_]{0,63}. + description (str): One or more paragraphs of text description. + properties (dict): The properties of this entity. + read_only (bool): Whether this resource is read only. """ def __init__( @@ -28,6 +28,19 @@ def __init__( properties: Mapping[str, Union[str, bool, int, float]], read_only: bool = False, ): + """ + Create a relationship type resource in the Data API. + + Args: + name: The resource name of the relationship type, for example + "relationshipTypes/namespace.relationshipTypeIdentifier". The namespace + must be empty (being global) or one of the predetermined namespaces the + customer has access to. The relationship type identifier must match the + regex [A-Z][A-Z0-9_]{0,63}. + description: One or more paragraphs of text description. + properties: The properties of this entity. + read_only: Whether this resource is read only. + """ self.name = name self.description = description self.properties = properties diff --git a/exabel_data_sdk/client/api/data_classes/request_error.py b/exabel_data_sdk/client/api/data_classes/request_error.py index 49c2c29..8469049 100644 --- a/exabel_data_sdk/client/api/data_classes/request_error.py +++ b/exabel_data_sdk/client/api/data_classes/request_error.py @@ -26,15 +26,21 @@ class ErrorType(Enum): class RequestError(Exception): - """Represents an error returned from the Exabel Api.""" + """ + Represents an error returned from the Exabel Api. + + Attributes: + error_type (ErrorType): Type of error. + message (str): Exception message. + """ def __init__(self, error_type: ErrorType, message: str = None): """ Create a new RequestError. Args: - error_type: type of error - message: exception message + error_type: Type of error. + message: Exception message. """ super().__init__(message) self.error_type = error_type diff --git a/exabel_data_sdk/client/api/data_classes/signal.py b/exabel_data_sdk/client/api/data_classes/signal.py index 41ad0aa..7b5d14f 100644 --- a/exabel_data_sdk/client/api/data_classes/signal.py +++ b/exabel_data_sdk/client/api/data_classes/signal.py @@ -7,13 +7,14 @@ class Signal: A signal resource in the Data API. Attributes: - name: The resource name of the signal, for example "signals/signalIdentifier" or - "signals/namespace.signalIdentifier". The namespace must be empty (being - global) or one of the predetermined namespaces the customer has access to. The - signal identifier must match the regex [a-zA-Z]\w{0,63}. - display_name: The display name of the signal. - description: One or more paragraphs of text description. - read_only: Whether this Signal is read only. + name (str): The resource name of the signal, for example + "signals/signalIdentifier" or "signals/namespace.signalIdentifier". + The namespace must be empty (being global) or one of the + predetermined namespaces the customer has access to. The signal + identifier must match the regex [a-zA-Z]\w{0,63}. + display_name (str): The display name of the signal. + description (str): One or more paragraphs of text description. + read_only (bool): Whether this Signal is read only. """ def __init__( @@ -23,6 +24,18 @@ def __init__( description: str, read_only: bool = False, ): + r""" + Create a signal resource in the Data API. + + Args: + name: The resource name of the signal, for example "signals/signalIdentifier" or + "signals/namespace.signalIdentifier". The namespace must be empty (being + global) or one of the predetermined namespaces the customer has access + to. The signal identifier must match the regex [a-zA-Z]\w{0,63}. + display_name: The display name of the signal. + description: One or more paragraphs of text description. + read_only: Whether this Signal is read only. + """ self.name = name self.display_name = display_name self.description = description diff --git a/setup.py b/setup.py index bab88b4..f4688e8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="exabel-data-sdk", - version="0.0.17", + version="0.0.18", author="Exabel", author_email="support@exabel.com", description="Python SDK for the Exabel Data API",