Ejemplo n.º 1
0
def update(id, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["id"] = id
    if "id" in params and not isinstance(params["id"], int):
        raise InvalidParameterError("Bad parameter: id must be an int")
    if "project_id" in params and not isinstance(params["project_id"], int):
        raise InvalidParameterError("Bad parameter: project_id must be an int")
    if "subject" in params and not isinstance(params["subject"], str):
        raise InvalidParameterError("Bad parameter: subject must be an str")
    if "body" in params and not isinstance(params["body"], str):
        raise InvalidParameterError("Bad parameter: body must be an str")
    if "id" not in params:
        raise MissingParameterError("Parameter missing: id")
    if "project_id" not in params:
        raise MissingParameterError("Parameter missing: project_id")
    if "subject" not in params:
        raise MissingParameterError("Parameter missing: subject")
    if "body" not in params:
        raise MissingParameterError("Parameter missing: body")
    response, options = Api.send_request(
        "PATCH", "/messages/{id}".format(id=params['id']), params, options)
    return Message(response.data, options)
Ejemplo n.º 2
0
    def update(self, params=None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "id") and self.id:
            params['id'] = self.id
        else:
            raise MissingParameterError("Current object doesn't have a id")
        if "id" not in params:
            raise MissingParameterError("Parameter missing: id")
        if "id" in params and not isinstance(params["id"], int):
            raise InvalidParameterError("Bad parameter: id must be an int")
        if "name" in params and not isinstance(params["name"], str):
            raise InvalidParameterError("Bad parameter: name must be an str")
        if "expires_at" in params and not isinstance(params["expires_at"],
                                                     str):
            raise InvalidParameterError(
                "Bad parameter: expires_at must be an str")
        if "permission_set" in params and not isinstance(
                params["permission_set"], str):
            raise InvalidParameterError(
                "Bad parameter: permission_set must be an str")
        response, _options = Api.send_request(
            "PATCH", "/api_keys/{id}".format(id=params['id']), params,
            self.options)
        return response.data
Ejemplo n.º 3
0
    def update(self, params=None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "id") and self.id:
            params['id'] = self.id
        else:
            raise MissingParameterError("Current object doesn't have a id")
        if "id" not in params:
            raise MissingParameterError("Parameter missing: id")
        if "project_id" not in params:
            raise MissingParameterError("Parameter missing: project_id")
        if "subject" not in params:
            raise MissingParameterError("Parameter missing: subject")
        if "body" not in params:
            raise MissingParameterError("Parameter missing: body")
        if "id" in params and not isinstance(params["id"], int):
            raise InvalidParameterError("Bad parameter: id must be an int")
        if "project_id" in params and not isinstance(params["project_id"],
                                                     int):
            raise InvalidParameterError(
                "Bad parameter: project_id must be an int")
        if "subject" in params and not isinstance(params["subject"], str):
            raise InvalidParameterError(
                "Bad parameter: subject must be an str")
        if "body" in params and not isinstance(params["body"], str):
            raise InvalidParameterError("Bad parameter: body must be an str")
        response, _options = Api.send_request(
            "PATCH", "/messages/{id}".format(id=params['id']), params,
            self.options)
        return response.data
Ejemplo n.º 4
0
    def begin_upload(self, params=None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "path") and self.path:
            params['path'] = self.path
        else:
            raise MissingParameterError("Current object doesn't have a path")
        if "path" not in params:
            raise MissingParameterError("Parameter missing: path")
        if "path" in params and not isinstance(params["path"], str):
            raise InvalidParameterError("Bad parameter: path must be an str")
        if "part" in params and not isinstance(params["part"], int):
            raise InvalidParameterError("Bad parameter: part must be an int")
        if "parts" in params and not isinstance(params["parts"], int):
            raise InvalidParameterError("Bad parameter: parts must be an int")
        if "ref" in params and not isinstance(params["ref"], str):
            raise InvalidParameterError("Bad parameter: ref must be an str")
        if "restart" in params and not isinstance(params["restart"], int):
            raise InvalidParameterError(
                "Bad parameter: restart must be an int")
        response, _options = Api.send_request(
            "POST",
            "/file_actions/begin_upload/{path}".format(path=params['path']),
            params, self.options)
        return response.data
Ejemplo n.º 5
0
    def update(self, params=None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "id") and self.id:
            params['id'] = self.id
        else:
            raise MissingParameterError("Current object doesn't have a id")
        if "id" not in params:
            raise MissingParameterError("Parameter missing: id")
        if "id" in params and not isinstance(params["id"], int):
            raise InvalidParameterError("Bad parameter: id must be an int")
        if "name" in params and not isinstance(params["name"], str):
            raise InvalidParameterError("Bad parameter: name must be an str")
        if "body" in params and not isinstance(params["body"], str):
            raise InvalidParameterError("Bad parameter: body must be an str")
        if "use_with_bundles" in params and not isinstance(
                params["use_with_bundles"], str):
            raise InvalidParameterError(
                "Bad parameter: use_with_bundles must be an str")
        if "use_with_inboxes" in params and not isinstance(
                params["use_with_inboxes"], str):
            raise InvalidParameterError(
                "Bad parameter: use_with_inboxes must be an str")
        if "use_with_users" in params and not isinstance(
                params["use_with_users"], str):
            raise InvalidParameterError(
                "Bad parameter: use_with_users must be an str")
        response, _options = Api.send_request(
            "PATCH", "/clickwraps/{id}".format(id=params['id']), params,
            self.options)
        return response.data
Ejemplo n.º 6
0
def update(id, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["id"] = id
    if "id" in params and not isinstance(params["id"], int):
        raise InvalidParameterError("Bad parameter: id must be an int")
    if "automation" in params and not isinstance(params["automation"], str):
        raise InvalidParameterError("Bad parameter: automation must be an str")
    if "source" in params and not isinstance(params["source"], str):
        raise InvalidParameterError("Bad parameter: source must be an str")
    if "destination" in params and not isinstance(params["destination"], str):
        raise InvalidParameterError(
            "Bad parameter: destination must be an str")
    if "destinations" in params and not isinstance(params["destinations"],
                                                   list):
        raise InvalidParameterError(
            "Bad parameter: destinations must be an list")
    if "destination_replace_from" in params and not isinstance(
            params["destination_replace_from"], str):
        raise InvalidParameterError(
            "Bad parameter: destination_replace_from must be an str")
    if "destination_replace_to" in params and not isinstance(
            params["destination_replace_to"], str):
        raise InvalidParameterError(
            "Bad parameter: destination_replace_to must be an str")
    if "interval" in params and not isinstance(params["interval"], str):
        raise InvalidParameterError("Bad parameter: interval must be an str")
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "user_ids" in params and not isinstance(params["user_ids"], str):
        raise InvalidParameterError("Bad parameter: user_ids must be an str")
    if "group_ids" in params and not isinstance(params["group_ids"], str):
        raise InvalidParameterError("Bad parameter: group_ids must be an str")
    if "schedule" in params and not isinstance(params["schedule"], dict):
        raise InvalidParameterError("Bad parameter: schedule must be an dict")
    if "trigger" in params and not isinstance(params["trigger"], str):
        raise InvalidParameterError("Bad parameter: trigger must be an str")
    if "trigger_actions" in params and not isinstance(
            params["trigger_actions"], list):
        raise InvalidParameterError(
            "Bad parameter: trigger_actions must be an list")
    if "trigger_action_path" in params and not isinstance(
            params["trigger_action_path"], str):
        raise InvalidParameterError(
            "Bad parameter: trigger_action_path must be an str")
    if "value" in params and not isinstance(params["value"], dict):
        raise InvalidParameterError("Bad parameter: value must be an dict")
    if "id" not in params:
        raise MissingParameterError("Parameter missing: id")
    if "automation" not in params:
        raise MissingParameterError("Parameter missing: automation")
    response, options = Api.send_request(
        "PATCH", "/automations/{id}".format(id=params['id']), params, options)
    return Automation(response.data, options)
Ejemplo n.º 7
0
    def delete(self, params = None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "id") and self.id:
            params['id'] = self.id
        else:
            raise MissingParameterError("Current object doesn't have a id")
        if "id" not in params:
            raise MissingParameterError("Parameter missing: id")
        if "id" in params and not isinstance(params["id"], int):
            raise InvalidParameterError("Bad parameter: id must be an int")
        response, _options = Api.send_request("DELETE", "/projects/{id}".format(id=params['id']), params, self.options)
        return response.data
Ejemplo n.º 8
0
def create(params = None, options = None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "group_id" in params and not isinstance(params["group_id"], int):
        raise InvalidParameterError("Bad parameter: group_id must be an int")
    if "user_id" in params and not isinstance(params["user_id"], int):
        raise InvalidParameterError("Bad parameter: user_id must be an int")
    if "group_id" not in params:
        raise MissingParameterError("Parameter missing: group_id")
    if "user_id" not in params:
        raise MissingParameterError("Parameter missing: user_id")
    response, options = Api.send_request("POST", "/group_users", params, options)
    return GroupUser(response.data, options)
Ejemplo n.º 9
0
def update(path, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["path"] = path
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    if "file" not in params:
        raise MissingParameterError("Parameter missing: file")
    response, options = Api.send_request(
        "PATCH", "/styles/{path}".format(path=params['path']), params, options)
    return Style(response.data, options)
Ejemplo n.º 10
0
def delete(path, params = None, options = None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["path"] = path
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "token" in params and not isinstance(params["token"], str):
        raise InvalidParameterError("Bad parameter: token must be an str")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    if "token" not in params:
        raise MissingParameterError("Parameter missing: token")
    response, _options = Api.send_request("DELETE", "/locks/{path}".format(path=params['path']), params, options)
    return response.data
Ejemplo n.º 11
0
def create(params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "body" in params and not isinstance(params["body"], str):
        raise InvalidParameterError("Bad parameter: body must be an str")
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "body" not in params:
        raise MissingParameterError("Parameter missing: body")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    response, options = Api.send_request("POST", "/file_comments", params,
                                         options)
    return FileComment(response.data, options)
Ejemplo n.º 12
0
def create(path, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["path"] = path
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "action" in params and not isinstance(params["action"], str):
        raise InvalidParameterError("Bad parameter: action must be an str")
    if "length" in params and not isinstance(params["length"], int):
        raise InvalidParameterError("Bad parameter: length must be an int")
    if "part" in params and not isinstance(params["part"], int):
        raise InvalidParameterError("Bad parameter: part must be an int")
    if "parts" in params and not isinstance(params["parts"], int):
        raise InvalidParameterError("Bad parameter: parts must be an int")
    if "provided_mtime" in params and not isinstance(params["provided_mtime"],
                                                     str):
        raise InvalidParameterError(
            "Bad parameter: provided_mtime must be an str")
    if "ref" in params and not isinstance(params["ref"], str):
        raise InvalidParameterError("Bad parameter: ref must be an str")
    if "restart" in params and not isinstance(params["restart"], int):
        raise InvalidParameterError("Bad parameter: restart must be an int")
    if "size" in params and not isinstance(params["size"], int):
        raise InvalidParameterError("Bad parameter: size must be an int")
    if "structure" in params and not isinstance(params["structure"], str):
        raise InvalidParameterError("Bad parameter: structure must be an str")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    response, options = Api.send_request(
        "POST", "/files/{path}".format(path=params['path']), params, options)
    return File(response.data, options)
Ejemplo n.º 13
0
def begin_upload(path, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["path"] = path
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "part" in params and not isinstance(params["part"], int):
        raise InvalidParameterError("Bad parameter: part must be an int")
    if "parts" in params and not isinstance(params["parts"], int):
        raise InvalidParameterError("Bad parameter: parts must be an int")
    if "ref" in params and not isinstance(params["ref"], str):
        raise InvalidParameterError("Bad parameter: ref must be an str")
    if "restart" in params and not isinstance(params["restart"], int):
        raise InvalidParameterError("Bad parameter: restart must be an int")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    response, options = Api.send_request(
        "POST",
        "/file_actions/begin_upload/{path}".format(path=params['path']),
        params, options)
    return [
        FileUploadPart(entity_data, options) for entity_data in response.data
    ]
Ejemplo n.º 14
0
def update(id, params = None, options = None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["id"] = id
    if "id" in params and not isinstance(params["id"], int):
        raise InvalidParameterError("Bad parameter: id must be an int")
    if "global_access" in params and not isinstance(params["global_access"], str):
        raise InvalidParameterError("Bad parameter: global_access must be an str")
    if "id" not in params:
        raise MissingParameterError("Parameter missing: id")
    if "global_access" not in params:
        raise MissingParameterError("Parameter missing: global_access")
    response, options = Api.send_request("PATCH", "/projects/{id}".format(id=params['id']), params, options)
    return Project(response.data, options)
Ejemplo n.º 15
0
def list_for_folder(path, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["path"] = path
    if "start_at" in params and not isinstance(params["start_at"], str):
        raise InvalidParameterError("Bad parameter: start_at must be an str")
    if "end_at" in params and not isinstance(params["end_at"], str):
        raise InvalidParameterError("Bad parameter: end_at must be an str")
    if "display" in params and not isinstance(params["display"], str):
        raise InvalidParameterError("Bad parameter: display must be an str")
    if "cursor" in params and not isinstance(params["cursor"], str):
        raise InvalidParameterError("Bad parameter: cursor must be an str")
    if "per_page" in params and not isinstance(params["per_page"], int):
        raise InvalidParameterError("Bad parameter: per_page must be an int")
    if "sort_by" in params and not isinstance(params["sort_by"], dict):
        raise InvalidParameterError("Bad parameter: sort_by must be an dict")
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    return ListObj(Action, "GET",
                   "/history/folders/{path}".format(path=params['path']),
                   params, options)
Ejemplo n.º 16
0
    def delete(self, params=None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "path") and self.path:
            params['path'] = self.path
        else:
            raise MissingParameterError("Current object doesn't have a path")
        if "path" not in params:
            raise MissingParameterError("Parameter missing: path")
        if "path" in params and not isinstance(params["path"], str):
            raise InvalidParameterError("Bad parameter: path must be an str")
        response, _options = Api.send_request(
            "DELETE", "/styles/{path}".format(path=params['path']), params,
            self.options)
        return response.data
Ejemplo n.º 17
0
def list_for_user(user_id, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["user_id"] = user_id
    if "start_at" in params and not isinstance(params["start_at"], str):
        raise InvalidParameterError("Bad parameter: start_at must be an str")
    if "end_at" in params and not isinstance(params["end_at"], str):
        raise InvalidParameterError("Bad parameter: end_at must be an str")
    if "display" in params and not isinstance(params["display"], str):
        raise InvalidParameterError("Bad parameter: display must be an str")
    if "cursor" in params and not isinstance(params["cursor"], str):
        raise InvalidParameterError("Bad parameter: cursor must be an str")
    if "per_page" in params and not isinstance(params["per_page"], int):
        raise InvalidParameterError("Bad parameter: per_page must be an int")
    if "sort_by" in params and not isinstance(params["sort_by"], dict):
        raise InvalidParameterError("Bad parameter: sort_by must be an dict")
    if "user_id" in params and not isinstance(params["user_id"], int):
        raise InvalidParameterError("Bad parameter: user_id must be an int")
    if "user_id" not in params:
        raise MissingParameterError("Parameter missing: user_id")
    return ListObj(
        Action, "GET",
        "/history/users/{user_id}".format(user_id=params['user_id']), params,
        options)
Ejemplo n.º 18
0
def list(params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "user_id" in params and not isinstance(params["user_id"], int):
        raise InvalidParameterError("Bad parameter: user_id must be an int")
    if "cursor" in params and not isinstance(params["cursor"], str):
        raise InvalidParameterError("Bad parameter: cursor must be an str")
    if "per_page" in params and not isinstance(params["per_page"], int):
        raise InvalidParameterError("Bad parameter: per_page must be an int")
    if "sort_by" in params and not isinstance(params["sort_by"], dict):
        raise InvalidParameterError("Bad parameter: sort_by must be an dict")
    if "filter" in params and not isinstance(params["filter"], dict):
        raise InvalidParameterError("Bad parameter: filter must be an dict")
    if "filter_gt" in params and not isinstance(params["filter_gt"], dict):
        raise InvalidParameterError("Bad parameter: filter_gt must be an dict")
    if "filter_gteq" in params and not isinstance(params["filter_gteq"], dict):
        raise InvalidParameterError(
            "Bad parameter: filter_gteq must be an dict")
    if "filter_like" in params and not isinstance(params["filter_like"], dict):
        raise InvalidParameterError(
            "Bad parameter: filter_like must be an dict")
    if "filter_lt" in params and not isinstance(params["filter_lt"], dict):
        raise InvalidParameterError("Bad parameter: filter_lt must be an dict")
    if "filter_lteq" in params and not isinstance(params["filter_lteq"], dict):
        raise InvalidParameterError(
            "Bad parameter: filter_lteq must be an dict")
    if "bundle_id" in params and not isinstance(params["bundle_id"], int):
        raise InvalidParameterError("Bad parameter: bundle_id must be an int")
    if "bundle_id" not in params:
        raise MissingParameterError("Parameter missing: bundle_id")
    return ListObj(BundleRecipient, "GET", "/bundle_recipients", params,
                   options)
Ejemplo n.º 19
0
def update(id, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["id"] = id
    if "id" in params and not isinstance(params["id"], int):
        raise InvalidParameterError("Bad parameter: id must be an int")
    if "name" in params and not isinstance(params["name"], str):
        raise InvalidParameterError("Bad parameter: name must be an str")
    if "body" in params and not isinstance(params["body"], str):
        raise InvalidParameterError("Bad parameter: body must be an str")
    if "use_with_bundles" in params and not isinstance(
            params["use_with_bundles"], str):
        raise InvalidParameterError(
            "Bad parameter: use_with_bundles must be an str")
    if "use_with_inboxes" in params and not isinstance(
            params["use_with_inboxes"], str):
        raise InvalidParameterError(
            "Bad parameter: use_with_inboxes must be an str")
    if "use_with_users" in params and not isinstance(params["use_with_users"],
                                                     str):
        raise InvalidParameterError(
            "Bad parameter: use_with_users must be an str")
    if "id" not in params:
        raise MissingParameterError("Parameter missing: id")
    response, options = Api.send_request(
        "PATCH", "/clickwraps/{id}".format(id=params['id']), params, options)
    return Clickwrap(response.data, options)
Ejemplo n.º 20
0
    def update(self, params=None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "id") and self.id:
            params['id'] = self.id
        else:
            raise MissingParameterError("Current object doesn't have a id")
        if "id" not in params:
            raise MissingParameterError("Parameter missing: id")
        if "id" in params and not isinstance(params["id"], int):
            raise InvalidParameterError("Bad parameter: id must be an int")
        if "paths" in params and not isinstance(params["paths"], list):
            raise InvalidParameterError("Bad parameter: paths must be an list")
        if "password" in params and not isinstance(params["password"], str):
            raise InvalidParameterError(
                "Bad parameter: password must be an str")
        if "form_field_set_id" in params and not isinstance(
                params["form_field_set_id"], int):
            raise InvalidParameterError(
                "Bad parameter: form_field_set_id must be an int")
        if "clickwrap_id" in params and not isinstance(params["clickwrap_id"],
                                                       int):
            raise InvalidParameterError(
                "Bad parameter: clickwrap_id must be an int")
        if "code" in params and not isinstance(params["code"], str):
            raise InvalidParameterError("Bad parameter: code must be an str")
        if "description" in params and not isinstance(params["description"],
                                                      str):
            raise InvalidParameterError(
                "Bad parameter: description must be an str")
        if "expires_at" in params and not isinstance(params["expires_at"],
                                                     str):
            raise InvalidParameterError(
                "Bad parameter: expires_at must be an str")
        if "inbox_id" in params and not isinstance(params["inbox_id"], int):
            raise InvalidParameterError(
                "Bad parameter: inbox_id must be an int")
        if "max_uses" in params and not isinstance(params["max_uses"], int):
            raise InvalidParameterError(
                "Bad parameter: max_uses must be an int")
        if "note" in params and not isinstance(params["note"], str):
            raise InvalidParameterError("Bad parameter: note must be an str")
        response, _options = Api.send_request(
            "PATCH", "/bundles/{id}".format(id=params['id']), params,
            self.options)
        return response.data
Ejemplo n.º 21
0
def create(params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "value" in params and not isinstance(params["value"], str):
        raise InvalidParameterError("Bad parameter: value must be an str")
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "behavior" in params and not isinstance(params["behavior"], str):
        raise InvalidParameterError("Bad parameter: behavior must be an str")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    if "behavior" not in params:
        raise MissingParameterError("Parameter missing: behavior")
    response, options = Api.send_request("POST", "/behaviors", params, options)
    return Behavior(response.data, options)
Ejemplo n.º 22
0
    def update(self, params = None):
        if not isinstance(params, dict):
            params = {}

        if hasattr(self, "id") and self.id:
            params['id'] = self.id
        else:
            raise MissingParameterError("Current object doesn't have a id")
        if "id" not in params:
            raise MissingParameterError("Parameter missing: id")
        if "id" in params and not isinstance(params["id"], int):
            raise InvalidParameterError("Bad parameter: id must be an int")
        if "title" in params and not isinstance(params["title"], str):
            raise InvalidParameterError("Bad parameter: title must be an str")
        if "form_fields" in params and not isinstance(params["form_fields"], list):
            raise InvalidParameterError("Bad parameter: form_fields must be an list")
        response, _options = Api.send_request("PATCH", "/form_field_sets/{id}".format(id=params['id']), params, self.options)
        return response.data
Ejemplo n.º 23
0
def move(path, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["path"] = path
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "destination" in params and not isinstance(params["destination"], str):
        raise InvalidParameterError(
            "Bad parameter: destination must be an str")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    if "destination" not in params:
        raise MissingParameterError("Parameter missing: destination")
    response, options = Api.send_request(
        "POST", "/file_actions/move/{path}".format(path=params['path']),
        params, options)
    return FileAction(response.data, options)
Ejemplo n.º 24
0
def create(params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "user_id" in params and not isinstance(params["user_id"], int):
        raise InvalidParameterError("Bad parameter: user_id must be an int")
    if "as2_partnership_name" in params and not isinstance(
            params["as2_partnership_name"], str):
        raise InvalidParameterError(
            "Bad parameter: as2_partnership_name must be an str")
    if "public_key" in params and not isinstance(params["public_key"], str):
        raise InvalidParameterError("Bad parameter: public_key must be an str")
    if "as2_partnership_name" not in params:
        raise MissingParameterError("Parameter missing: as2_partnership_name")
    if "public_key" not in params:
        raise MissingParameterError("Parameter missing: public_key")
    response, options = Api.send_request("POST", "/as2_keys", params, options)
    return As2Key(response.data, options)
Ejemplo n.º 25
0
def update(id, params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["id"] = id
    if "id" in params and not isinstance(params["id"], int):
        raise InvalidParameterError("Bad parameter: id must be an int")
    if "as2_partnership_name" in params and not isinstance(
            params["as2_partnership_name"], str):
        raise InvalidParameterError(
            "Bad parameter: as2_partnership_name must be an str")
    if "id" not in params:
        raise MissingParameterError("Parameter missing: id")
    if "as2_partnership_name" not in params:
        raise MissingParameterError("Parameter missing: as2_partnership_name")
    response, options = Api.send_request(
        "PATCH", "/as2_keys/{id}".format(id=params['id']), params, options)
    return As2Key(response.data, options)
Ejemplo n.º 26
0
def delete(id, params = None, options = None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    params["id"] = id
    if "id" in params and not isinstance(params["id"], int):
        raise InvalidParameterError("Bad parameter: id must be an int")
    if "group_id" in params and not isinstance(params["group_id"], int):
        raise InvalidParameterError("Bad parameter: group_id must be an int")
    if "user_id" in params and not isinstance(params["user_id"], int):
        raise InvalidParameterError("Bad parameter: user_id must be an int")
    if "id" not in params:
        raise MissingParameterError("Parameter missing: id")
    if "group_id" not in params:
        raise MissingParameterError("Parameter missing: group_id")
    if "user_id" not in params:
        raise MissingParameterError("Parameter missing: user_id")
    response, _options = Api.send_request("DELETE", "/group_users/{id}".format(id=params['id']), params, options)
    return response.data
Ejemplo n.º 27
0
def create(params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "path" in params and not isinstance(params["path"], str):
        raise InvalidParameterError("Bad parameter: path must be an str")
    if "destination" in params and not isinstance(params["destination"], str):
        raise InvalidParameterError(
            "Bad parameter: destination must be an str")
    if "user_ids" in params and not isinstance(params["user_ids"], str):
        raise InvalidParameterError("Bad parameter: user_ids must be an str")
    if "group_ids" in params and not isinstance(params["group_ids"], str):
        raise InvalidParameterError("Bad parameter: group_ids must be an str")
    if "path" not in params:
        raise MissingParameterError("Parameter missing: path")
    if "destination" not in params:
        raise MissingParameterError("Parameter missing: destination")
    response, options = Api.send_request("POST", "/requests", params, options)
    return Request(response.data, options)
Ejemplo n.º 28
0
def create(params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "name" in params and not isinstance(params["name"], str):
        raise InvalidParameterError("Bad parameter: name must be an str")
    if "email" in params and not isinstance(params["email"], str):
        raise InvalidParameterError("Bad parameter: email must be an str")
    if "details" in params and not isinstance(params["details"], str):
        raise InvalidParameterError("Bad parameter: details must be an str")
    if "name" not in params:
        raise MissingParameterError("Parameter missing: name")
    if "email" not in params:
        raise MissingParameterError("Parameter missing: email")
    if "details" not in params:
        raise MissingParameterError("Parameter missing: details")
    response, options = Api.send_request("POST", "/user_requests", params,
                                         options)
    return UserRequest(response.data, options)
Ejemplo n.º 29
0
def create(params=None, options=None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "user_id" in params and not isinstance(params["user_id"], int):
        raise InvalidParameterError("Bad parameter: user_id must be an int")
    if "file_comment_id" in params and not isinstance(
            params["file_comment_id"], int):
        raise InvalidParameterError(
            "Bad parameter: file_comment_id must be an int")
    if "emoji" in params and not isinstance(params["emoji"], str):
        raise InvalidParameterError("Bad parameter: emoji must be an str")
    if "file_comment_id" not in params:
        raise MissingParameterError("Parameter missing: file_comment_id")
    if "emoji" not in params:
        raise MissingParameterError("Parameter missing: emoji")
    response, options = Api.send_request("POST", "/file_comment_reactions",
                                         params, options)
    return FileCommentReaction(response.data, options)
Ejemplo n.º 30
0
def create(params = None, options = None):
    if not isinstance(params, dict):
        params = {}
    if not isinstance(options, dict):
        options = {}
    if "global_access" in params and not isinstance(params["global_access"], str):
        raise InvalidParameterError("Bad parameter: global_access must be an str")
    if "global_access" not in params:
        raise MissingParameterError("Parameter missing: global_access")
    response, options = Api.send_request("POST", "/projects", params, options)
    return Project(response.data, options)