Skip to content

Commit bcc28f6

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#265)
1 parent 81453ce commit bcc28f6

File tree

6 files changed

+31
-20
lines changed

6 files changed

+31
-20
lines changed

api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Methods:
243243
Types:
244244

245245
```python
246-
from python_intercom.types import ConversationList, ConversationListResponse
246+
from python_intercom.types import Conversation, ConversationListResponse, ConversationSearchResponse
247247
```
248248

249249
Methods:
@@ -254,7 +254,7 @@ Methods:
254254
- <code title="get /conversations">client.conversations.<a href="./src/python_intercom/resources/conversations/conversations.py">list</a>(\*\*<a href="src/python_intercom/types/conversation_list_params.py">params</a>) -> <a href="./src/python_intercom/types/conversation_list_response.py">SyncCursorPagination[ConversationListResponse]</a></code>
255255
- <code title="post /conversations/{id}/convert">client.conversations.<a href="./src/python_intercom/resources/conversations/conversations.py">convert</a>(id, \*\*<a href="src/python_intercom/types/conversation_convert_params.py">params</a>) -> <a href="./src/python_intercom/types/shared/ticket.py">Optional</a></code>
256256
- <code title="post /conversations/redact">client.conversations.<a href="./src/python_intercom/resources/conversations/conversations.py">redact</a>(\*\*<a href="src/python_intercom/types/conversation_redact_params.py">params</a>) -> <a href="./src/python_intercom/types/shared/conversation.py">Conversation</a></code>
257-
- <code title="post /conversations/search">client.conversations.<a href="./src/python_intercom/resources/conversations/conversations.py">search</a>(\*\*<a href="src/python_intercom/types/conversation_search_params.py">params</a>) -> <a href="./src/python_intercom/types/conversation_list.py">ConversationList</a></code>
257+
- <code title="post /conversations/search">client.conversations.<a href="./src/python_intercom/resources/conversations/conversations.py">search</a>(\*\*<a href="src/python_intercom/types/conversation_search_params.py">params</a>) -> <a href="./src/python_intercom/types/conversation_search_response.py">ConversationSearchResponse</a></code>
258258

259259
## Tags
260260

bin/check-release-environment

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
#!/usr/bin/env bash
22

3+
warnings=()
34
errors=()
45

56
if [ -z "${PYPI_TOKEN}" ]; then
6-
errors+=("The INTERCOM_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
7+
warnings+=("The INTERCOM_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
8+
fi
9+
10+
lenWarnings=${#warnings[@]}
11+
12+
if [[ lenWarnings -gt 0 ]]; then
13+
echo -e "Found the following warnings in the release environment:\n"
14+
15+
for warning in "${warnings[@]}"; do
16+
echo -e "- $warning\n"
17+
done
718
fi
819

920
lenErrors=${#errors[@]}

src/python_intercom/resources/conversations/conversations.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
)
7878
from ...types.shared.ticket import Ticket
7979
from ...types.shared.message import Message
80-
from ...types.conversation_list import ConversationList
8180
from ...types.shared.conversation import Conversation
8281
from ...types.conversation_list_response import ConversationListResponse
82+
from ...types.conversation_search_response import ConversationSearchResponse
8383

8484
__all__ = ["ConversationsResource", "AsyncConversationsResource"]
8585

@@ -739,7 +739,7 @@ def search(
739739
extra_query: Query | None = None,
740740
extra_body: Body | None = None,
741741
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
742-
) -> ConversationList:
742+
) -> ConversationSearchResponse:
743743
"""
744744
You can search for multiple conversations by the value of their attributes in
745745
order to fetch exactly which ones you want.
@@ -883,7 +883,7 @@ def search(
883883
options=make_request_options(
884884
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
885885
),
886-
cast_to=ConversationList,
886+
cast_to=ConversationSearchResponse,
887887
)
888888

889889

@@ -1544,7 +1544,7 @@ async def search(
15441544
extra_query: Query | None = None,
15451545
extra_body: Body | None = None,
15461546
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1547-
) -> ConversationList:
1547+
) -> ConversationSearchResponse:
15481548
"""
15491549
You can search for multiple conversations by the value of their attributes in
15501550
order to fetch exactly which ones you want.
@@ -1688,7 +1688,7 @@ async def search(
16881688
options=make_request_options(
16891689
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
16901690
),
1691-
cast_to=ConversationList,
1691+
cast_to=ConversationSearchResponse,
16921692
)
16931693

16941694

src/python_intercom/types/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
from .contact_archived import ContactArchived as ContactArchived
5252
from .help_center_list import HelpCenterList as HelpCenterList
5353
from .ticket_type_list import TicketTypeList as TicketTypeList
54-
from .conversation_list import ConversationList as ConversationList
5554
from .contact_unarchived import ContactUnarchived as ContactUnarchived
5655
from .data_event_summary import DataEventSummary as DataEventSummary
5756
from .company_list_params import CompanyListParams as CompanyListParams
@@ -94,6 +93,7 @@
9493
from .tag_create_or_update_params import TagCreateOrUpdateParams as TagCreateOrUpdateParams
9594
from .company_retrieve_list_params import CompanyRetrieveListParams as CompanyRetrieveListParams
9695
from .conversation_retrieve_params import ConversationRetrieveParams as ConversationRetrieveParams
96+
from .conversation_search_response import ConversationSearchResponse as ConversationSearchResponse
9797
from .data_attribute_create_params import DataAttributeCreateParams as DataAttributeCreateParams
9898
from .data_attribute_update_params import DataAttributeUpdateParams as DataAttributeUpdateParams
9999
from .data_export_content_data_params import DataExportContentDataParams as DataExportContentDataParams

src/python_intercom/types/conversation_list.py renamed to src/python_intercom/types/conversation_search_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
from .shared.conversation import Conversation
88
from .shared.cursor_pages import CursorPages
99

10-
__all__ = ["ConversationList"]
10+
__all__ = ["ConversationSearchResponse"]
1111

1212

13-
class ConversationList(BaseModel):
13+
class ConversationSearchResponse(BaseModel):
1414
conversations: Optional[List[Conversation]] = None
1515
"""The list of conversation objects"""
1616

tests/api_resources/test_conversations.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from tests.utils import assert_matches_type
1111
from python_intercom import Intercom, AsyncIntercom
1212
from python_intercom.types import (
13-
ConversationList,
1413
ConversationListResponse,
14+
ConversationSearchResponse,
1515
)
1616
from python_intercom.pagination import SyncCursorPagination, AsyncCursorPagination
1717
from python_intercom.types.shared import Ticket, Message, Conversation
@@ -342,7 +342,7 @@ def test_method_search(self, client: Intercom) -> None:
342342
conversation = client.conversations.search(
343343
query={},
344344
)
345-
assert_matches_type(ConversationList, conversation, path=["response"])
345+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
346346

347347
@parametrize
348348
def test_method_search_with_all_params(self, client: Intercom) -> None:
@@ -358,7 +358,7 @@ def test_method_search_with_all_params(self, client: Intercom) -> None:
358358
},
359359
intercom_version="2.11",
360360
)
361-
assert_matches_type(ConversationList, conversation, path=["response"])
361+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
362362

363363
@parametrize
364364
def test_raw_response_search(self, client: Intercom) -> None:
@@ -369,7 +369,7 @@ def test_raw_response_search(self, client: Intercom) -> None:
369369
assert response.is_closed is True
370370
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
371371
conversation = response.parse()
372-
assert_matches_type(ConversationList, conversation, path=["response"])
372+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
373373

374374
@parametrize
375375
def test_streaming_response_search(self, client: Intercom) -> None:
@@ -380,7 +380,7 @@ def test_streaming_response_search(self, client: Intercom) -> None:
380380
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
381381

382382
conversation = response.parse()
383-
assert_matches_type(ConversationList, conversation, path=["response"])
383+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
384384

385385
assert cast(Any, response.is_closed) is True
386386

@@ -708,7 +708,7 @@ async def test_method_search(self, async_client: AsyncIntercom) -> None:
708708
conversation = await async_client.conversations.search(
709709
query={},
710710
)
711-
assert_matches_type(ConversationList, conversation, path=["response"])
711+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
712712

713713
@parametrize
714714
async def test_method_search_with_all_params(self, async_client: AsyncIntercom) -> None:
@@ -724,7 +724,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncIntercom)
724724
},
725725
intercom_version="2.11",
726726
)
727-
assert_matches_type(ConversationList, conversation, path=["response"])
727+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
728728

729729
@parametrize
730730
async def test_raw_response_search(self, async_client: AsyncIntercom) -> None:
@@ -735,7 +735,7 @@ async def test_raw_response_search(self, async_client: AsyncIntercom) -> None:
735735
assert response.is_closed is True
736736
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
737737
conversation = await response.parse()
738-
assert_matches_type(ConversationList, conversation, path=["response"])
738+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
739739

740740
@parametrize
741741
async def test_streaming_response_search(self, async_client: AsyncIntercom) -> None:
@@ -746,6 +746,6 @@ async def test_streaming_response_search(self, async_client: AsyncIntercom) -> N
746746
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
747747

748748
conversation = await response.parse()
749-
assert_matches_type(ConversationList, conversation, path=["response"])
749+
assert_matches_type(ConversationSearchResponse, conversation, path=["response"])
750750

751751
assert cast(Any, response.is_closed) is True

0 commit comments

Comments
 (0)