Source code for api.system.components.code.v1.profile

"""Autogenerated API"""
import requests
from argus_cli.plugin import register_command


[docs]@register_command(extending=('system','components','code','v1','profile')) def list(orderDesc: bool = None, limit: int = 25, offset: int = 0, orderBy: str = 'name',json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """List code profiles (INTERNAL) :param bool orderDesc: Sort results descending :param int limit: Limit results :param int offset: Offset results :param str orderBy: Sort results :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 434, "limit": 37, "responseCode": 200, "count": 33, "data": [{"id": 517, "name": "Bradley Lee", "flags": 975, "created": 411, "createdByUser": {"id": 903, "customerID": 562, "userName": "kathryn65", "name": "Juan Clark"}, "lastUpdatedTimestamp": 1099669702, "lastUpdatedByUser": {"id": 351, "customerID": 951, "userName": "shunt", "name": "Amanda Pennington"}, "artifacts": [{"id": "Growth visit approach whatever.", "groupID": "Peace wear use fish.", "artifactID": "Spend similar serve tell mother.", "version": "Particularly total than reduce.", "flags": 308, "status": "DELETED", "createdTimestamp": 1408923449, "lastUpdatedTimestamp": 284886820, "length": 996, "data": "Full purpose remain rich."}], "deleted": true, "finalized": false}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Serve develop yes yard issue.", "messageTemplate": "Dog degree share want.", "field": "Little whole always why point local.", "parameter": {}, "timestamp": 1397759996}], "currentPage": 391, "size": 247} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if limit: body.update({"limit": limit}) if offset: body.update({"offset": offset}) if orderBy: body.update({"orderBy": orderBy}) if orderDesc: body.update({"orderDesc": orderDesc}) response = get(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def create(name: str = None, artifactsToAttach: list = None, finalize: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Add new code profile (INTERNAL) :param str name: [a-zA-Z0-9_\-\.]* :param list artifactsToAttach: :param bool finalize: :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 998, "limit": 362, "responseCode": 200, "count": 835, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Partner system family culture.", "messageTemplate": "Accept level opportunity own community culture.", "field": "Meet even dog west factor.", "parameter": {}, "timestamp": 799169130}], "currentPage": 907, "size": 180} """ from requests import post from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if name: body.update({"name": name}) if artifactsToAttach: body.update({"artifactsToAttach": artifactsToAttach}) if finalize: body.update({"finalize": finalize}) response = post(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def get_by_id(id: int,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Get code profile by ID (INTERNAL) :param int id: ID of profile to fetch :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 600, "limit": 726, "responseCode": 200, "count": 487, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Over visit leader better.", "messageTemplate": "Kid on far room condition add either.", "field": "Sense pretty learn indicate.", "parameter": {}, "timestamp": 435201527}], "currentPage": 591, "size": 799} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{id}".format(id=id) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def update(id: int, name: str = None, finalized: bool = 'False', useForUnknown: bool = 'False', setAsDefault: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Update code profile (INTERNAL) :param int id: ID of profile to update :param str name: [a-zA-Z0-9_\-\.]* :param bool finalized: :param bool useForUnknown: :param bool setAsDefault: :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 492, "limit": 518, "responseCode": 200, "count": 659, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Knowledge can member evidence dark small government.", "messageTemplate": "Ever staff protect pick sister.", "field": "Until party fire notice.", "parameter": {}, "timestamp": 773109939}], "currentPage": 145, "size": 529} """ from requests import put from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{id}".format(id=id) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if name: body.update({"name": name}) if finalized: body.update({"finalized": finalized}) if useForUnknown: body.update({"useForUnknown": useForUnknown}) if setAsDefault: body.update({"setAsDefault": setAsDefault}) response = put(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def delete(id: int,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Mark code profile as deleted (INTERNAL) :param int id: ID of profile to delete :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 901, "limit": 813, "responseCode": 200, "count": 458, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Medical sign save for.", "messageTemplate": "Performance human protect dinner.", "field": "Probably clear those commercial analysis according.", "parameter": {}, "timestamp": 369434938}], "currentPage": 716, "size": 433} """ from requests import delete from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{id}".format(id=id) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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 = delete(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def duplicate(id: int, name: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Duplicate existing code profile (INTERNAL) :param int id: ID of profile to duplicate :param str name: Name of new profile :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 348, "limit": 205, "responseCode": 200, "count": 979, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Move national develop live.", "messageTemplate": "Thing kid both performance eat would.", "field": "Top pretty particular difficult responsibility hold.", "parameter": {}, "timestamp": 789341290}], "currentPage": 295, "size": 657} """ from requests import post from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{id}/duplicate/{name}".format(id=id, name=name) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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 = post(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def get_by_name(name: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Get code profile by name (INTERNAL) :param str name: Name of profile to fetch :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 717, "limit": 713, "responseCode": 200, "count": 846, "data": [{"id": 614, "name": "Kelli Lutz", "flags": 541, "created": 485, "createdByUser": {"id": 292, "customerID": 822, "userName": "jonathan10", "name": "Terri Fowler"}, "lastUpdatedTimestamp": 688596507, "lastUpdatedByUser": {"id": 847, "customerID": 749, "userName": "ygarrett", "name": "Tracie Terrell"}, "artifacts": [{"id": "Enter rich successful very town they.", "groupID": "Back someone product heavy left allow audience.", "artifactID": "Where art reason talk wide group nice crime.", "version": "Explain establish box laugh rule hair.", "flags": 919, "status": "UNUSED", "createdTimestamp": 725965946, "lastUpdatedTimestamp": 1134582673, "length": 801, "data": "Score trip rise then thank debate."}], "deleted": true, "finalized": false}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Large fact possible person bag.", "messageTemplate": "Thought camera century program along although movement.", "field": "Word central ten whether off.", "parameter": {}, "timestamp": 644469347}], "currentPage": 121, "size": 317} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{name}".format(name=name) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def attach_detach(profileID: int, artifactsToAttach: list = None, artifactsToDetach: list = None,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Attach and detach artifact to given profile (INTERNAL) :param int profileID: ID of profile to detach from :param list artifactsToAttach: :param list artifactsToDetach: :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 291, "limit": 262, "responseCode": 200, "count": 673, "metaData": {"additionalProperties": {}}, "messages": [{"message": "End or mission bring read exactly wide join.", "messageTemplate": "Happy clear manage.", "field": "Organization cause five student huge share positive.", "parameter": {}, "timestamp": 1253654022}], "currentPage": 401, "size": 990} """ from requests import put from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{profileID}/artifacts".format(profileID=profileID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if artifactsToAttach: body.update({"artifactsToAttach": artifactsToAttach}) if artifactsToDetach: body.update({"artifactsToDetach": artifactsToDetach}) response = put(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def attach(profileID: int, artifactID: list,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Attach artifact to profile (INTERNAL) :param int profileID: ID of profile to attach to :param list artifactID: Hash ID of artifacts to attach :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 351, "limit": 324, "responseCode": 200, "count": 883, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Establish new lot employee serious life agent.", "messageTemplate": "Pretty agreement attorney sell organization member.", "field": "Other according well science listen suffer skin.", "parameter": {}, "timestamp": 321484118}], "currentPage": 750, "size": 426} """ from requests import post from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{profileID}/artifacts/{artifactID}".format(profileID=profileID, artifactID=artifactID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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 = post(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def detach(profileID: int, artifactID: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Detach artifact to profile (INTERNAL) :param int profileID: ID of profile to detach from :param str artifactID: Hash ID of artifact to detach :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 696, "limit": 469, "responseCode": 200, "count": 179, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Us human risk special seem.", "messageTemplate": "Even near rise blue.", "field": "Glass rich open sport citizen miss.", "parameter": {}, "timestamp": 600496866}], "currentPage": 814, "size": 122} """ from requests import delete from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{profileID}/artifacts/{artifactID}".format(profileID=profileID, artifactID=artifactID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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 = delete(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def detach_by_artifact_by_g_a(profileName: str, groupID: str, artifactID: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Detach artifact from profile by profile name and artifact GAV (INTERNAL) Will detach all artifacts with given group ID artifact ID, regardless of version :param str profileName: Name of profile to detach from :param str groupID: GroupID of artifact to detach :param str artifactID: ArtifactID of artifact to detach :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 308, "limit": 449, "responseCode": 200, "count": 787, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Seven almost trial daughter answer short.", "messageTemplate": "Message offer apply alone rock strong.", "field": "Everyone still property news analysis.", "parameter": {}, "timestamp": 1398004550}], "currentPage": 719, "size": 13} """ from requests import delete from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{profileName}/artifacts/{groupID}/{artifactID}".format(profileName=profileName, groupID=groupID, artifactID=artifactID) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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 = delete(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def attach_by_name(profileName: str, groupID: str, artifactID: str, version: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Attach artifact to profile by profile name and artifact GAV (INTERNAL) :param str profileName: Name of profile to attach to :param str groupID: GroupID of artifact to attach :param str artifactID: ArtifactID of artifact to attach :param str version: Version of artifact to attach :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 633, "limit": 874, "responseCode": 200, "count": 192, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Even name within during.", "messageTemplate": "Exactly want cultural more face reduce boy.", "field": "Should enter again recognize against.", "parameter": {}, "timestamp": 1086345610}], "currentPage": 811, "size": 923} """ from requests import post from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{profileName}/artifacts/{groupID}/{artifactID}/{version}".format(profileName=profileName, groupID=groupID, artifactID=artifactID, version=version) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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 = post(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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
[docs]@register_command(extending=('system','components','code','v1','profile')) def detach_by_name(profileName: str, groupID: str, artifactID: str, version: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Detach artifact from profile by profile name and artifact GAV (INTERNAL) :param str profileName: Name of profile to detach from :param str groupID: GroupID of artifact to detach :param str artifactID: ArtifactID of artifact to detach :param str version: Version of artifact to detach :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :raises ObjectNotFoundException: on 404 :returns: {"offset": 798, "limit": 899, "responseCode": 200, "count": 251, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Trouble mind this direction.", "messageTemplate": "Say prevent time voice hit story.", "field": "Republican skill while too.", "parameter": {}, "timestamp": 971012118}], "currentPage": 643, "size": 212} """ from requests import delete from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/system/components/code/v1/profile/{profileName}/artifacts/{groupID}/{artifactID}/{version}".format(profileName=profileName, groupID=groupID, artifactID=artifactID, version=version) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } 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 = delete(url, json=body if body else None, verify=verify, headers=headers) errors = [] 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