Source code for api.documents.v1.customer.customer
"""Autogenerated API"""
from argus_cli.plugin import register_command
[docs]@register_command(extending=("documents","v1","customer",""))
def get_customer_root_folder(
customerID: int,
json: bool = True,
verify: bool = True,
apiKey: str = None,
authentication: dict = {}
) -> dict:
"""Fetch customer root folder (PUBLIC)
:param int customerID: ID of customer to fetch root folder for
:raises AuthenticationFailedException: on 401
:raises ValidationFailedException: on 412
:raises AccessDeniedException: on 403
:returns: {'offset': 503, 'limit': 10, 'responseCode': 200, 'count': 847, 'metaData': {'additionalProperties': {}}, 'messages': [{'message': 'Under improve man look debate federal stuff.', 'messageTemplate': 'With value world list buy walk.', 'field': 'Process despite put child beautiful protect.', 'parameter': {}, 'timestamp': 1137540253}], 'currentPage': 735, 'size': 829}
"""
from requests import get
from argus_api.exceptions import http
url = "https://portal.mnemonic.no/web/api/documents/v1/customer/{customerID}".format(customerID=customerID)
headers = {
'Content-Type': 'application/json',
'User-Agent': 'ArgusToolbelt/'
}
if apiKey:
headers["Argus-API-Key"] = apiKey
elif authentication and isinstance(authentication, dict):
headers.update(authentication)
elif callable(authentication):
headers.update(authentication(url))
body = {
}
response = get(url,
json=body if body else None,
verify=verify,
headers=headers
)
if response.status_code == 401:
raise http.AuthenticationFailedException(response)
elif response.status_code == 403:
raise http.AccessDeniedException(response)
elif response.status_code == 412:
raise http.ValidationErrorException(response)
elif response.status_code == 404:
raise http.ObjectNotFoundException(response)
return response.json() if json else response