api.reports.v1.schedule — Argus-Toolbelt 1.0 documentation

# Source code for api.reports.v1.schedule

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

    @register_command(extending=('reports','v1','schedule'))
    def get_search(offset: int = None, customerID: list = None, planID: list = None, limit: int = 25,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
        """List report schedules (DEV)
    Returns a list of matching report schedules.

        :param int offset: Offset result
        :param list customerID: Limit to plans from this customer
        :param list planID: Limit to plans for this plan
        :param int limit: Limit output
        :raises AuthenticationFailedException: on 401
        :raises ValidationFailedException: on 412
        :raises AccessDeniedException: on 403
        :returns: {"offset": 603, "limit": 198, "responseCode": 200, "count": 708, "data": [{"id": 808, "flags": 287, "description": "Stand should management those but.", "schedule": "Strategy purpose pressure and star today.", "lastUpdatedTimestamp": 968414477, "lastUpdatedByUser": {"id": 726, "customerID": 587, "userName": "lynchcathy", "name": "Deanna Houston DDS"}, "globalCustomer": true}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Know result expect direction artist good.", "messageTemplate": "Subject pass site support different.", "field": "Of eat concern team up agency game.", "parameter": {}, "timestamp": 410218110}], "currentPage": 117, "size": 756}
        """
        from requests import get
        from argus_api.exceptions import http

        url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reports/v1/schedule".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 customerID:
            body.update({"customerID": customerID})

        if planID:
            body.update({"planID": planID})

        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

    @register_command(extending=('reports','v1','schedule'))
    def add(setFlags: int = None, description: str = None, planID: int = None, schedule: str = None,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
        """null (DEV)

        :param int setFlags:
        :param str description: Report schedule description  => [\s\w\{\}\$\-\(\)\.\[\]"\'_/\\,\*\+\#:@!?;]*
        :param int planID:
        :param str schedule: Report schedule
        :returns: {}
        """
        from requests import post
        from argus_api.exceptions import http

        url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reports/v1/schedule".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 setFlags:
            body.update({"setFlags": setFlags})

        if description:
            body.update({"description": description})

        if planID:
            body.update({"planID": planID})

        if schedule:
            body.update({"schedule": schedule})

        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

    @register_command(extending=('reports','v1','schedule'))
    def search(limit: int = None, offset: int = None, includeFlags: int = None, excludeFlags: int = None, subCriteria: list = None, customerID: list = None, id: list = None, lastUpdatedByUserID: list = None, planID: list = None, startTimestamp: int = None, endTimestamp: int = None, includeDeleted: bool = 'False', exclude: bool = 'False', required: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
        """Search report schedules (DEV)
    Returns a list of matching report schedules.

        :param int limit: Set this value to set max number of results. By default, no restriction on result set size.
        :param int offset: Set this value to skip the first (offset) objects. By default, return result from first object.
        :param int includeFlags: Only include objects which have includeFlags set.
        :param int excludeFlags: Exclude objects which have excludeFlags set.
        :param list subCriteria:
        :param list customerID: Restrict search to data belonging to specified customers.
        :param list id:
        :param list lastUpdatedByUserID:
        :param list planID:
        :param int startTimestamp:
        :param int endTimestamp:
        :param bool includeDeleted: Set to true to include deleted objects. By default, exclude deleted objects.
        :param bool exclude: Only relevant for subcriteria. If set to true, objects matching this subcriteria object will be excluded.
        :param bool required: Only relevant for subcriteria. If set to true, objects matching this subcriteria are required (AND-ed together with parent criteria).
        :raises AuthenticationFailedException: on 401
        :raises ValidationFailedException: on 412
        :raises AccessDeniedException: on 403
        :returns: {"offset": 830, "limit": 910, "responseCode": 200, "count": 784, "data": [{"id": 573, "flags": 52, "description": "Everybody send eat difference market another.", "schedule": "Detail help serve visit leg exist.", "lastUpdatedTimestamp": 1043144609, "lastUpdatedByUser": {"id": 369, "customerID": 1, "userName": "carterelizabeth", "name": "Nathan Hill"}, "globalCustomer": false}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Detail dark law prove figure claim save.", "messageTemplate": "Movement himself even compare school.", "field": "Bad glass hair beautiful.", "parameter": {}, "timestamp": 794656474}], "currentPage": 520, "size": 510}
        """
        from requests import post
        from argus_api.exceptions import http

        url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reports/v1/schedule/search".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 includeDeleted:
            body.update({"includeDeleted": includeDeleted})

        if includeFlags:
            body.update({"includeFlags": includeFlags})

        if excludeFlags:
            body.update({"excludeFlags": excludeFlags})

        if subCriteria:
            body.update({"subCriteria": subCriteria})

        if exclude:
            body.update({"exclude": exclude})

        if required:
            body.update({"required": required})

        if customerID:
            body.update({"customerID": customerID})

        if id:
            body.update({"id": id})

        if lastUpdatedByUserID:
            body.update({"lastUpdatedByUserID": lastUpdatedByUserID})

        if planID:
            body.update({"planID": planID})

        if startTimestamp:
            body.update({"startTimestamp": startTimestamp})

        if endTimestamp:
            body.update({"endTimestamp": endTimestamp})

        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

    @register_command(extending=('reports','v1','schedule'))
    def get(id: int,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
        """Fetch a report schedule (DEV)

        :param int id: ID of schedule to fetch
        :raises AuthenticationFailedException: on 401
        :raises ValidationFailedException: on 412
        :raises AccessDeniedException: on 403
        :raises ScheduleNotFoundException: on 404
        :returns: {"offset": 626, "limit": 767, "responseCode": 200, "count": 963, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Listen management mother accept statement.", "messageTemplate": "Special sister father necessary seek.", "field": "Dark until include tonight Congress debate rise.", "parameter": {}, "timestamp": 406436141}], "currentPage": 885, "size": 799}
        """
        from requests import get
        from argus_api.exceptions import http

        url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reports/v1/schedule/{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

    @register_command(extending=('reports','v1','schedule'))
    def delete(id: int,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
        """Delete a report schedule (DEV)

        :param int id: ID of plan to delete
        :raises AuthenticationFailedException: on 401
        :raises ValidationFailedException: on 412
        :raises AccessDeniedException: on 403
        :raises ObjectNotFoundException: on 404
        :returns: {"offset": 851, "limit": 45, "responseCode": 200, "count": 587, "metaData": {"additionalProperties": {}}, "messages": [{"message": "Dinner herself should green couple.", "messageTemplate": "View remember look trade far listen maybe.", "field": "May oil pressure draw laugh or.", "parameter": {}, "timestamp": 998758538}], "currentPage": 387, "size": 794}
        """
        from requests import delete
        from argus_api.exceptions import http

        url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reports/v1/schedule/{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

    @register_command(extending=('reports','v1','schedule'))
    def generate_from_schedule(id: int,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict:
        """null (DEV)

        :param int id:
        :returns: {}
        """
        from requests import post
        from argus_api.exceptions import http

        url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reports/v1/schedule/{id}/generate".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 = 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