Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@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)
@extract_id(Section)
def articles(self, section):
return self._query_zendesk(self.endpoint.articles, 'article', id=section)
@extract_id(Post, Comment)
def delete(self, post, comment):
return PostCommentRequest(self).delete(self.endpoint.delete, post, comment)
@extract_id(Topic)
def posts(self, topic):
url = self._build_url(self.endpoint.posts(id=topic))
return self._get(url)
@extract_id(Topic)
def topics(self, topic):
return self._query_zendesk(self.endpoint.topics, object_type='topic', id=topic)
@extract_id(Article, Comment)
def show(self, article, comment):
url = self._build_url(self.endpoint.comment_show(article, comment))
return self._get(url)
@extract_id(Translation)
def delete_translation(self, translation):
return TranslationRequest(self).delete(self.endpoint.delete_translation, translation)
@extract_id(Post)
def __call__(self, post):
return super(PostCommentApi, self).__call__(id=post)
@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)
@extract_id(ArticleAttachment)
def show(self, attachment):
return self._query_zendesk(self.endpoint, 'article_attachment', id=attachment)