From ebf4c58370608f9ae3d7750556294ec45b2b9bb4 Mon Sep 17 00:00:00 2001 From: Marco Julian Moser Date: Sat, 4 Nov 2023 14:16:52 +0000 Subject: [PATCH] added urls to docstrigs integration api --- src/sxapi/integrationV2/accounts.py | 6 ++++ src/sxapi/integrationV2/organisations.py | 36 ++++++++++++++++++++++++ src/sxapi/integrationV2/tranlations.py | 4 +++ src/sxapi/integrationV2/users.py | 4 +++ 4 files changed, 50 insertions(+) diff --git a/src/sxapi/integrationV2/accounts.py b/src/sxapi/integrationV2/accounts.py index ea98f62..10e76da 100644 --- a/src/sxapi/integrationV2/accounts.py +++ b/src/sxapi/integrationV2/accounts.py @@ -11,6 +11,8 @@ def __init__(self, api=None): def get_usages(self, **kwargs): """Get usages of provided account numbers. + https://api.smaxtec.com/integration/v2/accounts/usages + Args: **kwargs: Optional parameters of the API call. Find supported parameters under @@ -41,6 +43,8 @@ def put( ): """Update an account. + https://api.smaxtec.com/integration/v2/accounts/{account_nr} + Args: account_nr (str): Account number of the account account_name (str): Name of the account @@ -74,6 +78,8 @@ def put( def put_organisation(self, account_nr, organisation_id, **kwargs): """Add an account to an organisation. + https://api.smaxtec.com/integration/v2/accounts/{account_nr}/organisation/{organisation_id} + Args: account_nr (str): Account number of the account organisation_id (str): Organisation ID of the organisation diff --git a/src/sxapi/integrationV2/organisations.py b/src/sxapi/integrationV2/organisations.py index feea78d..5ab13f7 100644 --- a/src/sxapi/integrationV2/organisations.py +++ b/src/sxapi/integrationV2/organisations.py @@ -11,6 +11,8 @@ def __init__(self, api=None): def post(self, name, timezone, **kwargs): """Create an organisation. + https://api.smaxtec.com/integration/v2/organisations + Args: name (str): Name of the organisation timezone (str): Timezone of the organisation @@ -33,6 +35,8 @@ def post(self, name, timezone, **kwargs): def get(self, **kwargs): """Get all organisation the user has access to. + https://api.smaxtec.com/integration/v2/organisations + Args: **kwargs: Optional parameters of the API call. Find supported parameters under @@ -54,6 +58,8 @@ def get(self, **kwargs): def get_odoo_organisations(self, **kwargs): """Get all odoo organisations the user has access to. + https://api.smaxtec.com/integration/v2/organisations/odoo_organisations + Args: **kwargs: Optional parameters of the API call. Find supported parameters under @@ -76,6 +82,8 @@ def get_odoo_organisations(self, **kwargs): def get_animal_ids(self, organisation_id, **kwargs): """Get all animal official_ids of an organisation. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animal_ids + Args: organisation_id (str): Organisation ID of the organisation **kwargs: Optional parameters of the API call. @@ -98,6 +106,8 @@ def get_animal_ids(self, organisation_id, **kwargs): def put_animals(self, organisation_id, body, **kwargs): """Create/Update animals of an organisation. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals + Args: organisation_id (str): Organisation ID of the organisation body (:obj:`list` of :obj:`dict`): List of animals to create/update @@ -121,6 +131,8 @@ def put_animals(self, organisation_id, body, **kwargs): def get_animals(self, organisation_id, **kwargs): """Get all animals of an organisation. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals + Args: organisation_id (str): Organisation ID of the organisation **kwargs: Optional parameters of the API call. @@ -143,6 +155,8 @@ def get_animals(self, organisation_id, **kwargs): def put_animals_by_official_id(self, organisation_id, official_id, **kwargs): """Create/Update an animal of an organisation by official_id. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals/{official_id} + Args: organisation_id (str): Organisation ID of the organisation official_id (str): Official ID of the animal @@ -165,6 +179,8 @@ def put_animals_by_official_id(self, organisation_id, official_id, **kwargs): def get_animals_by_official_id(self, organisation_id, official_id, **kwargs): """Get an animal of an organisation by official_id. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals/{official_id} + Args: organisation_id (str): Organisation ID of the organisation official_id (str): Official ID of the animal @@ -190,6 +206,8 @@ def get_animals_data_by_official_id( ): """Get sensordata of an animal by official_id. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals/{official_id}/data.json + Args: organisation_id (str): Organisation ID of the organisation official_id (str): Official ID of the animal @@ -224,6 +242,8 @@ def put_animals_events_by_official_id( ): """Create/Update events of an animal by official_id. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals/{official_id}/events + Args: organisation_id (str): Organisation ID of the organisation official_id (str): Official ID of the animal @@ -249,6 +269,8 @@ def put_animals_events_by_official_id( def get_animals_events_by_official_id(self, organisation_id, official_id, **kwargs): """Get events of an animal by official_id. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals/{official_id}/events + Args: organisation_id (str): Organisation ID of the organisation official_id (str): Official ID of the animal @@ -276,6 +298,8 @@ def get_animals_metrics_by_official_id( ): """Get a list of metrics available for animal. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals/{official_id}/metrics + Args: organisation_id (str): Organisation ID of the organisation official_id (str): Official ID of the animal @@ -300,6 +324,8 @@ def get_animals_metrics_by_official_id( def put_animals_events(self, organisation_id, events, **kwargs): """Create/Update events of an organisation. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/animals_events + Args: organisation_id (str): Organisation ID of the organisation events (:obj:`list` of :obj:`dict`): List of events to create/update @@ -322,6 +348,8 @@ def put_animals_events(self, organisation_id, events, **kwargs): def get_devices(self, organisation_id, **kwargs): """Get all devices of an organisation. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/devices + Args: organisation_id (str): ID of the organisation **kwargs: Optional parameters of the API call. @@ -346,6 +374,8 @@ def get_devices_data( ): """Get sensordata of a device. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/devices/{device_id}/data.json + Args: organisation_id (str): ID of the organisation device_id (str): ID of the device @@ -377,6 +407,8 @@ def get_devices_data( def get_devices_readouts_latest(self, organisation_id, device_id, **kwargs): """Get latest readout of a device. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/devices/{device_id}/readouts/latest + Args: organisation_id (str): ID of the organisation device_id (str): ID of the device @@ -402,6 +434,8 @@ def get_devices_readouts_latest(self, organisation_id, device_id, **kwargs): def get_events(self, organisation_id, **kwargs): """Get all events of an organisation. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/events + Args: organisation_id (str): ID of the organisation **kwargs: Optional parameters of the API call. @@ -424,6 +458,8 @@ def get_events(self, organisation_id, **kwargs): def get_simple_animals(self, organisation_id, **kwargs): """Get all animals of an organisation. + https://api.smaxtec.com/integration/v2/organisations/{organisation_id}/simple_animals + Args: organisation_id (str): ID of the organisation **kwargs: Optional parameters of the API call. diff --git a/src/sxapi/integrationV2/tranlations.py b/src/sxapi/integrationV2/tranlations.py index 70f79ab..432aa1c 100644 --- a/src/sxapi/integrationV2/tranlations.py +++ b/src/sxapi/integrationV2/tranlations.py @@ -11,6 +11,8 @@ def __init__(self, api=None): def get_events(self, language, **kwargs): """Get translations for events. + https://api.smaxtec.com/integration/v2/translations/{language}/events + Args: language (str): Language of the events to be returned **kwargs: Optional parameters of the API call. @@ -33,6 +35,8 @@ def get_events(self, language, **kwargs): def get_event_types(self, language, event_type, **kwargs): """Get translations for event types. + https://api.smaxtec.com/integration/v2/translations/{language}/events/{event_type} + Args: language (str): Language of the event types to be returned event_type (str): Type of the event types to be returned diff --git a/src/sxapi/integrationV2/users.py b/src/sxapi/integrationV2/users.py index 139f176..95bf231 100644 --- a/src/sxapi/integrationV2/users.py +++ b/src/sxapi/integrationV2/users.py @@ -11,6 +11,8 @@ def __init__(self, api=None): def get(self, **kwargs): """Grant access to demo farm + https://api.smaxtec.com/integration/v2/users + Args: **kwargs: Optional parameters of the API call. Find supported parameters under @@ -31,6 +33,8 @@ def get(self, **kwargs): def post_session_token(self, user, password, **kwargs): """Creates a new session token. + https://api.smaxtec.com/integration/v2/users/session_token + Args: user (str): Email of the user to be logged in password (str): Password of the user to be logged in