How to use the boxsdk.util.api_call_decorator.api_call function in boxsdk

To help you get started, we’ve selected a few boxsdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github box / box-python-sdk / test / unit / util / test_api_call_decorator.py View on Github external
    @api_call
    def api_call_method(self, *args, **kwargs):
        return self, args, kwargs, api_call_result
github box / box-python-sdk / boxsdk / object / file.py View on Github external
    @api_call
    def get_shared_link_download_url(
            self,
            access=None,
            etag=None,
            unshared_at=None,
            allow_preview=None,
            password=None,
    ):
        """
        Get a shared link download url for the file with the given access permissions.
        This url is a direct download url for the file.

        :param access:
            Determines who can access the shared link. May be open, company, or collaborators. If no access is
            specified, the default access will be used.
        :type access:
github box / box-python-sdk / boxsdk / object / file.py View on Github external
    @api_call
    def create_task(self, message=None, due_at=None):
        """
        Create a task on the given file.

        :param message:
            An optional message to include in the task.
        :type message:
            `unicode` or None
        :param due_at:
            When this task is due.
        :type due_at:
            `unicode` or None
        :return:
            The newly created task
        :rtype:
            :class:`Task`
github box / box-python-sdk / boxsdk / object / legal_hold_policy.py View on Github external
    @api_call
    def assign(self, assignee):
        """Assign legal hold policy

        :param assignee:
            The `file_version`, `file`, `folder`, or `user` to assign the legal hold policy to.
        :type assignee:
            :class:`FileVersion` :class:`File` or :class:`Folder` or :class:`User`
        :returns:
            A legal hold policy assignment object
        :rtype:
            :class:`LegalHoldPolicyAssignment`
        """
        url = self._session.get_url('legal_hold_policy_assignments')
        body = {
            'policy_id': self.object_id,
            'assign_to': {
github box / box-python-sdk / boxsdk / object / retention_policy.py View on Github external
    @api_call
    def assign(self, assignee, fields=None):
        """Assign a retention policy to a Box item

        :param assignee:
            The item to assign the retention policy on.
        :type assignee:
            :class:`Folder`, :class:`Enterprise`, or :class:`MetadataTemplate`
        :param fields:
            List of fields to request.
        :type fields:
            `Iterable` of `unicode`
        :returns:
            A :class:`RetentionPolicyAssignment` object.
        :rtype:
            :class:`RetentionPolicyAssignment`
        """
github box / box-python-sdk / boxsdk / object / file.py View on Github external
    @api_call
    def get_previous_versions(self, limit=None, offset=None, fields=None):
        """
        Get previous versions of the file.

        :param limit:
            The maximum number of items to return per page. If not specified, then will use the server-side default.
        :type limit:
            `int` or None
        :param offset:
            The index at which to start returning items.
        :type offset:
            `int`
        :param fields:
            List of fields to request.
        :type fields:
            `Iterable` of `unicode`
github box / box-python-sdk / boxsdk / client / client.py View on Github external
    @api_call
    def get_recent_items(self, limit=None, marker=None, fields=None, **collection_kwargs):
        """
        Get the user's recently accessed items.

        :param: limit
            The maximum number of items to return. If limit is set to None, then the default
            limit (returned by Box in the response) is used. See https://developer.box.com/en/reference/get-recent-items/
            for default.
        :type: limit
            `int` or None
        :param marker:
            The index at which to start returning items.
        :type marker:
            `str` or None
        :param fields:
            List of fields to request on the file or folder which the `RecentItem` references.
github box / box-python-sdk / boxsdk / object / legal_hold_policy.py View on Github external
    @api_call
    def get_file_version_legal_holds(self, limit=None, marker=None, fields=None):
        """
        Get legal holds for a file version.

        :param limit:
            The maximum number of entries to return per page. If not specified, then will use the server-side default.
        :type limit:
            `int` or None
        :param marker:
            The paging marker to start paging from
        :type marker:
            `unicode` or None
        :param fields:
            List of fields to request
        :type fields:
            `Iterable` of `unicode`
github box / box-python-sdk / boxsdk / object / item.py View on Github external
    @api_call
    def collaborate(self, accessible_by, role, can_view_path=None, notify=None, fields=None):
        """Collaborate user or group onto a Box item.

        :param accessible_by:
            An object containing the collaborator.
        :type accessible_by:
            class:`User` or class:`Group`
        :param role:
            The permission level to grant the collaborator.
        :type role:
            `unicode`
        :param can_view_path:
            Indicates whether the user can view the path of the item collaborated into.  This can only be set for
            collaborations on folders.
        :type can_view_path:
            `bool` or None
github box / box-python-sdk / boxsdk / client / client.py View on Github external
    @api_call
    def get_metadata_templates(self, scope='enterprise', limit=None, marker=None, fields=None):
        """
        Get all metadata templates for a given scope.  By default, retrieves all metadata templates for the current
        enterprise.

        :param scope:
            The scope to retrieve templates for
        :type scope:
            `unicode`
        :type limit:
            `int` or None
        :param marker:
            The paging marker to start paging from.
        :type marker:
            `unicode` or None
        :param fields: