How to use the zenpy.lib.util.extract_id function in zenpy

To help you get started, we’ve selected a few zenpy 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 facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(User, Identity)
    def delete(self, user, identity):
        """
        Deletes the identity for a given user

        :param user: User id or object
        :param identity: Identity id or object
        :return: requests Response object
        """
        return UserIdentityRequest(self).delete(user, identity)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(Section)
    def articles(self, section):
        return self._query_zendesk(self.endpoint.articles, 'article', id=section)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(Post, Comment)
    def delete(self, post, comment):
        return PostCommentRequest(self).delete(self.endpoint.delete, post, comment)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(Topic)
    def posts(self, topic):
        url = self._build_url(self.endpoint.posts(id=topic))
        return self._get(url)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(Topic)
    def topics(self, topic):
        return self._query_zendesk(self.endpoint.topics, object_type='topic', id=topic)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(Article, Comment)
    def show(self, article, comment):
        url = self._build_url(self.endpoint.comment_show(article, comment))
        return self._get(url)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(Translation)
    def delete_translation(self, translation):
        return TranslationRequest(self).delete(self.endpoint.delete_translation, translation)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(Post)
    def __call__(self, post):
        return super(PostCommentApi, self).__call__(id=post)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(User, Identity)
    def verify(self, user, identity):
        """
        Verify an identity for a user

        :param user: User id or object
        :param identity: Identity id or object
        :return: the verified Identity
        """
        return UserIdentityRequest(self).put(self.endpoint.verify, user, identity)
github facetoe / zenpy / zenpy / lib / api.py View on Github external
    @extract_id(ArticleAttachment)
    def show(self, attachment):
        return self._query_zendesk(self.endpoint, 'article_attachment', id=attachment)