Skip to content

Commit c29da78

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#271)
1 parent 038341c commit c29da78

File tree

14 files changed

+126
-56
lines changed

14 files changed

+126
-56
lines changed

Diff for: api.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ from python_intercom.types import (
1515
Message,
1616
MultipleFilterSearchRequest,
1717
Note,
18-
PaginatedResponse,
1918
PartAttachment,
2019
Reference,
2120
SearchRequest,
@@ -365,35 +364,41 @@ Methods:
365364
Types:
366365

367366
```python
368-
from python_intercom.types.news import NewsItem, NewsItemDeleteResponse
367+
from python_intercom.types.news import NewsItem, NewsItemListResponse, NewsItemDeleteResponse
369368
```
370369

371370
Methods:
372371

373372
- <code title="post /news/news_items">client.news.news_items.<a href="./src/python_intercom/resources/news/news_items.py">create</a>(\*\*<a href="src/python_intercom/types/news/news_item_create_params.py">params</a>) -> <a href="./src/python_intercom/types/news/news_item.py">NewsItem</a></code>
374373
- <code title="get /news/news_items/{id}">client.news.news_items.<a href="./src/python_intercom/resources/news/news_items.py">retrieve</a>(id) -> <a href="./src/python_intercom/types/news/news_item.py">NewsItem</a></code>
375374
- <code title="put /news/news_items/{id}">client.news.news_items.<a href="./src/python_intercom/resources/news/news_items.py">update</a>(id, \*\*<a href="src/python_intercom/types/news/news_item_update_params.py">params</a>) -> <a href="./src/python_intercom/types/news/news_item.py">NewsItem</a></code>
376-
- <code title="get /news/news_items">client.news.news_items.<a href="./src/python_intercom/resources/news/news_items.py">list</a>() -> <a href="./src/python_intercom/types/shared/paginated_response.py">PaginatedResponse</a></code>
375+
- <code title="get /news/news_items">client.news.news_items.<a href="./src/python_intercom/resources/news/news_items.py">list</a>() -> <a href="./src/python_intercom/types/news/news_item_list_response.py">NewsItemListResponse</a></code>
377376
- <code title="delete /news/news_items/{id}">client.news.news_items.<a href="./src/python_intercom/resources/news/news_items.py">delete</a>(id) -> <a href="./src/python_intercom/types/news/news_item_delete_response.py">NewsItemDeleteResponse</a></code>
378377

379378
## Newsfeeds
380379

381380
Types:
382381

383382
```python
384-
from python_intercom.types.news import Newsfeed
383+
from python_intercom.types.news import Newsfeed, NewsfeedListResponse
385384
```
386385

387386
Methods:
388387

389388
- <code title="get /news/newsfeeds/{id}">client.news.newsfeeds.<a href="./src/python_intercom/resources/news/newsfeeds/newsfeeds.py">retrieve</a>(id) -> <a href="./src/python_intercom/types/news/newsfeed.py">Newsfeed</a></code>
390-
- <code title="get /news/newsfeeds">client.news.newsfeeds.<a href="./src/python_intercom/resources/news/newsfeeds/newsfeeds.py">list</a>() -> <a href="./src/python_intercom/types/shared/paginated_response.py">PaginatedResponse</a></code>
389+
- <code title="get /news/newsfeeds">client.news.newsfeeds.<a href="./src/python_intercom/resources/news/newsfeeds/newsfeeds.py">list</a>() -> <a href="./src/python_intercom/types/news/newsfeed_list_response.py">NewsfeedListResponse</a></code>
391390

392391
### Items
393392

393+
Types:
394+
395+
```python
396+
from python_intercom.types.news.newsfeeds import ItemListResponse
397+
```
398+
394399
Methods:
395400

396-
- <code title="get /news/newsfeeds/{id}/items">client.news.newsfeeds.items.<a href="./src/python_intercom/resources/news/newsfeeds/items.py">list</a>(id) -> <a href="./src/python_intercom/types/shared/paginated_response.py">PaginatedResponse</a></code>
401+
- <code title="get /news/newsfeeds/{id}/items">client.news.newsfeeds.items.<a href="./src/python_intercom/resources/news/newsfeeds/items.py">list</a>(id) -> <a href="./src/python_intercom/types/news/newsfeeds/item_list_response.py">ItemListResponse</a></code>
397402

398403
# Notes
399404

Diff for: src/python_intercom/resources/news/news_items.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from ...types.news import news_item_create_params, news_item_update_params
2626
from ..._base_client import make_request_options
2727
from ...types.news.news_item import NewsItem
28-
from ...types.shared.paginated_response import PaginatedResponse
28+
from ...types.news.news_item_list_response import NewsItemListResponse
2929
from ...types.news.news_item_delete_response import NewsItemDeleteResponse
3030

3131
__all__ = ["NewsItemsResource", "AsyncNewsItemsResource"]
@@ -327,7 +327,7 @@ def list(
327327
extra_query: Query | None = None,
328328
extra_body: Body | None = None,
329329
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
330-
) -> PaginatedResponse:
330+
) -> NewsItemListResponse:
331331
"""
332332
You can fetch a list of all news items
333333
@@ -352,7 +352,7 @@ def list(
352352
options=make_request_options(
353353
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
354354
),
355-
cast_to=PaginatedResponse,
355+
cast_to=NewsItemListResponse,
356356
)
357357

358358
def delete(
@@ -711,7 +711,7 @@ async def list(
711711
extra_query: Query | None = None,
712712
extra_body: Body | None = None,
713713
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
714-
) -> PaginatedResponse:
714+
) -> NewsItemListResponse:
715715
"""
716716
You can fetch a list of all news items
717717
@@ -736,7 +736,7 @@ async def list(
736736
options=make_request_options(
737737
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
738738
),
739-
cast_to=PaginatedResponse,
739+
cast_to=NewsItemListResponse,
740740
)
741741

742742
async def delete(

Diff for: src/python_intercom/resources/news/newsfeeds/items.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
async_to_streamed_response_wrapper,
1818
)
1919
from ...._base_client import make_request_options
20-
from ....types.shared.paginated_response import PaginatedResponse
20+
from ....types.news.newsfeeds.item_list_response import ItemListResponse
2121

2222
__all__ = ["ItemsResource", "AsyncItemsResource"]
2323

@@ -62,7 +62,7 @@ def list(
6262
extra_query: Query | None = None,
6363
extra_body: Body | None = None,
6464
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
65-
) -> PaginatedResponse:
65+
) -> ItemListResponse:
6666
"""
6767
You can fetch a list of all news items that are live on a given newsfeed
6868
@@ -89,7 +89,7 @@ def list(
8989
options=make_request_options(
9090
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
9191
),
92-
cast_to=PaginatedResponse,
92+
cast_to=ItemListResponse,
9393
)
9494

9595

@@ -133,7 +133,7 @@ async def list(
133133
extra_query: Query | None = None,
134134
extra_body: Body | None = None,
135135
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
136-
) -> PaginatedResponse:
136+
) -> ItemListResponse:
137137
"""
138138
You can fetch a list of all news items that are live on a given newsfeed
139139
@@ -160,7 +160,7 @@ async def list(
160160
options=make_request_options(
161161
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
162162
),
163-
cast_to=PaginatedResponse,
163+
cast_to=ItemListResponse,
164164
)
165165

166166

Diff for: src/python_intercom/resources/news/newsfeeds/newsfeeds.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
)
2727
from ...._base_client import make_request_options
2828
from ....types.news.newsfeed import Newsfeed
29-
from ....types.shared.paginated_response import PaginatedResponse
29+
from ....types.news.newsfeed_list_response import NewsfeedListResponse
3030

3131
__all__ = ["NewsfeedsResource", "AsyncNewsfeedsResource"]
3232

@@ -135,7 +135,7 @@ def list(
135135
extra_query: Query | None = None,
136136
extra_body: Body | None = None,
137137
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
138-
) -> PaginatedResponse:
138+
) -> NewsfeedListResponse:
139139
"""
140140
You can fetch a list of all newsfeeds
141141
@@ -160,7 +160,7 @@ def list(
160160
options=make_request_options(
161161
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
162162
),
163-
cast_to=PaginatedResponse,
163+
cast_to=NewsfeedListResponse,
164164
)
165165

166166

@@ -268,7 +268,7 @@ async def list(
268268
extra_query: Query | None = None,
269269
extra_body: Body | None = None,
270270
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
271-
) -> PaginatedResponse:
271+
) -> NewsfeedListResponse:
272272
"""
273273
You can fetch a list of all newsfeeds
274274
@@ -293,7 +293,7 @@ async def list(
293293
options=make_request_options(
294294
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
295295
),
296-
cast_to=PaginatedResponse,
296+
cast_to=NewsfeedListResponse,
297297
)
298298

299299

Diff for: src/python_intercom/types/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
ArticleContent as ArticleContent,
2121
PartAttachment as PartAttachment,
2222
ContactReference as ContactReference,
23-
PaginatedResponse as PaginatedResponse,
2423
StartingAfterPaging as StartingAfterPaging,
2524
TicketTypeAttribute as TicketTypeAttribute,
2625
SubscriptionTypeList as SubscriptionTypeList,

Diff for: src/python_intercom/types/news/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from .newsfeed import Newsfeed as Newsfeed
66
from .news_item import NewsItem as NewsItem
7+
from .newsfeed_list_response import NewsfeedListResponse as NewsfeedListResponse
78
from .news_item_create_params import NewsItemCreateParams as NewsItemCreateParams
9+
from .news_item_list_response import NewsItemListResponse as NewsItemListResponse
810
from .news_item_update_params import NewsItemUpdateParams as NewsItemUpdateParams
911
from .news_item_delete_response import NewsItemDeleteResponse as NewsItemDeleteResponse

Diff for: src/python_intercom/types/shared/paginated_response.py renamed to src/python_intercom/types/news/news_item_list_response.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
from typing import List, Union, Optional
44
from typing_extensions import Literal
55

6+
from .newsfeed import Newsfeed
67
from ..._models import BaseModel
7-
from .cursor_pages import CursorPages
8-
from ..news.newsfeed import Newsfeed
9-
from ..news.news_item import NewsItem
8+
from .news_item import NewsItem
9+
from ..shared.cursor_pages import CursorPages
1010

11-
__all__ = ["PaginatedResponse", "Data"]
11+
__all__ = ["NewsItemListResponse", "Data"]
1212

1313
Data = Union[NewsItem, Newsfeed]
1414

1515

16-
class PaginatedResponse(BaseModel):
16+
class NewsItemListResponse(BaseModel):
1717
data: Optional[List[Data]] = None
1818
"""An array of Objects"""
1919

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Union, Optional
4+
from typing_extensions import Literal
5+
6+
from .newsfeed import Newsfeed
7+
from ..._models import BaseModel
8+
from .news_item import NewsItem
9+
from ..shared.cursor_pages import CursorPages
10+
11+
__all__ = ["NewsfeedListResponse", "Data"]
12+
13+
Data = Union[NewsItem, Newsfeed]
14+
15+
16+
class NewsfeedListResponse(BaseModel):
17+
data: Optional[List[Data]] = None
18+
"""An array of Objects"""
19+
20+
pages: Optional[CursorPages] = None
21+
"""
22+
Cursor-based pagination is a technique used in the Intercom API to navigate
23+
through large amounts of data. A "cursor" or pointer is used to keep track of
24+
the current position in the result set, allowing the API to return the data in
25+
small chunks or "pages" as needed.
26+
"""
27+
28+
total_count: Optional[int] = None
29+
"""A count of the total number of objects."""
30+
31+
type: Optional[Literal["list", "conversation.list"]] = None
32+
"""The type of object"""

Diff for: src/python_intercom/types/news/newsfeeds/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from __future__ import annotations
4+
5+
from .item_list_response import ItemListResponse as ItemListResponse
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Union, Optional
4+
from typing_extensions import Literal
5+
6+
from ..newsfeed import Newsfeed
7+
from ...._models import BaseModel
8+
from ..news_item import NewsItem
9+
from ...shared.cursor_pages import CursorPages
10+
11+
__all__ = ["ItemListResponse", "Data"]
12+
13+
Data = Union[NewsItem, Newsfeed]
14+
15+
16+
class ItemListResponse(BaseModel):
17+
data: Optional[List[Data]] = None
18+
"""An array of Objects"""
19+
20+
pages: Optional[CursorPages] = None
21+
"""
22+
Cursor-based pagination is a technique used in the Intercom API to navigate
23+
through large amounts of data. A "cursor" or pointer is used to keep track of
24+
the current position in the result set, allowing the API to return the data in
25+
small chunks or "pages" as needed.
26+
"""
27+
28+
total_count: Optional[int] = None
29+
"""A count of the total number of objects."""
30+
31+
type: Optional[Literal["list", "conversation.list"]] = None
32+
"""The type of object"""

Diff for: src/python_intercom/types/shared/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from .article_content import ArticleContent as ArticleContent
1717
from .part_attachment import PartAttachment as PartAttachment
1818
from .contact_reference import ContactReference as ContactReference
19-
from .paginated_response import PaginatedResponse as PaginatedResponse
2019
from .starting_after_paging import StartingAfterPaging as StartingAfterPaging
2120
from .ticket_type_attribute import TicketTypeAttribute as TicketTypeAttribute
2221
from .subscription_type_list import SubscriptionTypeList as SubscriptionTypeList

Diff for: tests/api_resources/news/newsfeeds/test_items.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from tests.utils import assert_matches_type
1111
from python_intercom import Intercom, AsyncIntercom
12-
from python_intercom.types.shared import PaginatedResponse
12+
from python_intercom.types.news.newsfeeds import ItemListResponse
1313

1414
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1515

@@ -22,15 +22,15 @@ def test_method_list(self, client: Intercom) -> None:
2222
item = client.news.newsfeeds.items.list(
2323
id="123",
2424
)
25-
assert_matches_type(PaginatedResponse, item, path=["response"])
25+
assert_matches_type(ItemListResponse, item, path=["response"])
2626

2727
@parametrize
2828
def test_method_list_with_all_params(self, client: Intercom) -> None:
2929
item = client.news.newsfeeds.items.list(
3030
id="123",
3131
intercom_version="2.11",
3232
)
33-
assert_matches_type(PaginatedResponse, item, path=["response"])
33+
assert_matches_type(ItemListResponse, item, path=["response"])
3434

3535
@parametrize
3636
def test_raw_response_list(self, client: Intercom) -> None:
@@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Intercom) -> None:
4141
assert response.is_closed is True
4242
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4343
item = response.parse()
44-
assert_matches_type(PaginatedResponse, item, path=["response"])
44+
assert_matches_type(ItemListResponse, item, path=["response"])
4545

4646
@parametrize
4747
def test_streaming_response_list(self, client: Intercom) -> None:
@@ -52,7 +52,7 @@ def test_streaming_response_list(self, client: Intercom) -> None:
5252
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5353

5454
item = response.parse()
55-
assert_matches_type(PaginatedResponse, item, path=["response"])
55+
assert_matches_type(ItemListResponse, item, path=["response"])
5656

5757
assert cast(Any, response.is_closed) is True
5858

@@ -72,15 +72,15 @@ async def test_method_list(self, async_client: AsyncIntercom) -> None:
7272
item = await async_client.news.newsfeeds.items.list(
7373
id="123",
7474
)
75-
assert_matches_type(PaginatedResponse, item, path=["response"])
75+
assert_matches_type(ItemListResponse, item, path=["response"])
7676

7777
@parametrize
7878
async def test_method_list_with_all_params(self, async_client: AsyncIntercom) -> None:
7979
item = await async_client.news.newsfeeds.items.list(
8080
id="123",
8181
intercom_version="2.11",
8282
)
83-
assert_matches_type(PaginatedResponse, item, path=["response"])
83+
assert_matches_type(ItemListResponse, item, path=["response"])
8484

8585
@parametrize
8686
async def test_raw_response_list(self, async_client: AsyncIntercom) -> None:
@@ -91,7 +91,7 @@ async def test_raw_response_list(self, async_client: AsyncIntercom) -> None:
9191
assert response.is_closed is True
9292
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
9393
item = await response.parse()
94-
assert_matches_type(PaginatedResponse, item, path=["response"])
94+
assert_matches_type(ItemListResponse, item, path=["response"])
9595

9696
@parametrize
9797
async def test_streaming_response_list(self, async_client: AsyncIntercom) -> None:
@@ -102,7 +102,7 @@ async def test_streaming_response_list(self, async_client: AsyncIntercom) -> Non
102102
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
103103

104104
item = await response.parse()
105-
assert_matches_type(PaginatedResponse, item, path=["response"])
105+
assert_matches_type(ItemListResponse, item, path=["response"])
106106

107107
assert cast(Any, response.is_closed) is True
108108

0 commit comments

Comments
 (0)