Skip to content

Commit

Permalink
Updated articles api
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRy4n committed Sep 20, 2023
1 parent 60f0753 commit bd3c288
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 34 deletions.
11 changes: 0 additions & 11 deletions intercom_python_sdk/apis/articles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@
from .api import ArticlesAPI


class ArticleTranslation(ModelBase):
type: str

def __init__(self, *args, **kwargs):
self.type = kwargs.get('type', 'article_translated_content')

for language in ArticleLanguages:
locale_code = language.value
setattr(self, locale_code, kwargs.get(locale_code, None))


class ArticleStatistics(ModelBase):
"""
This model represents the statistics of an Article on Intercom.
Expand Down
18 changes: 0 additions & 18 deletions intercom_python_sdk/apis/articles/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,6 @@ def make_article(self, data, **kwargs):
return a_models.Article(**data)


class ArticleTranslationSchema(SchemaBase):
"""
This schema represents the translation of an Article on Intercom.
"""
type = fields.Str(default="article_translated_content")

def __init__(self, **kwargs):
super().__init__(**kwargs)
for language in ArticleLanguages:
locale_code = language.value
self.fields[locale_code] = fields.Str(allow_none=True, required=False)

@marshmallow.post_load
def make_article_translation(self, data, **kwargs):
return a_models.ArticleTranslation(**data)



class ArticlePagesSchema(SchemaBase):
""" Paging information for a list of Articles on Intercom. """
type = fields.Str(default='pages')
Expand Down
1 change: 0 additions & 1 deletion intercom_python_sdk/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
ArticleSchema,
ArticleListSchema,
ArticleStatisticsSchema,
ArticleTranslationSchema
)

from ..apis.data_attributes.schemas import (
Expand Down
4 changes: 0 additions & 4 deletions intercom_setup.py

This file was deleted.

0 comments on commit bd3c288

Please sign in to comment.