Skip to content

Commit

Permalink
added urls to docstrigs integration api
Browse files Browse the repository at this point in the history
  • Loading branch information
Mopsgeschwindigkeit committed Nov 4, 2023
1 parent a5cb9c3 commit ebf4c58
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sxapi/integrationV2/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions src/sxapi/integrationV2/organisations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/sxapi/integrationV2/tranlations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/sxapi/integrationV2/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ebf4c58

Please sign in to comment.