diff --git a/api.md b/api.md index 79fccd52..36a70db7 100644 --- a/api.md +++ b/api.md @@ -243,7 +243,7 @@ Methods: Types: ```python -from python_intercom.types import ConversationList, ConversationListResponse +from python_intercom.types import Conversation, ConversationListResponse, ConversationSearchResponse ``` Methods: @@ -254,7 +254,7 @@ Methods: - client.conversations.list(\*\*params) -> SyncCursorPagination[ConversationListResponse] - client.conversations.convert(id, \*\*params) -> Optional - client.conversations.redact(\*\*params) -> Conversation -- client.conversations.search(\*\*params) -> ConversationList +- client.conversations.search(\*\*params) -> ConversationSearchResponse ## Tags diff --git a/bin/check-release-environment b/bin/check-release-environment index 688f9f7e..b99d829c 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -1,9 +1,20 @@ #!/usr/bin/env bash +warnings=() errors=() if [ -z "${PYPI_TOKEN}" ]; then - errors+=("The INTERCOM_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") + warnings+=("The INTERCOM_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") +fi + +lenWarnings=${#warnings[@]} + +if [[ lenWarnings -gt 0 ]]; then + echo -e "Found the following warnings in the release environment:\n" + + for warning in "${warnings[@]}"; do + echo -e "- $warning\n" + done fi lenErrors=${#errors[@]} diff --git a/src/python_intercom/resources/conversations/conversations.py b/src/python_intercom/resources/conversations/conversations.py index bb5fe02c..e1b9625f 100644 --- a/src/python_intercom/resources/conversations/conversations.py +++ b/src/python_intercom/resources/conversations/conversations.py @@ -77,9 +77,9 @@ ) from ...types.shared.ticket import Ticket from ...types.shared.message import Message -from ...types.conversation_list import ConversationList from ...types.shared.conversation import Conversation from ...types.conversation_list_response import ConversationListResponse +from ...types.conversation_search_response import ConversationSearchResponse __all__ = ["ConversationsResource", "AsyncConversationsResource"] @@ -739,7 +739,7 @@ def search( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConversationList: + ) -> ConversationSearchResponse: """ You can search for multiple conversations by the value of their attributes in order to fetch exactly which ones you want. @@ -883,7 +883,7 @@ def search( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ConversationList, + cast_to=ConversationSearchResponse, ) @@ -1544,7 +1544,7 @@ async def search( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConversationList: + ) -> ConversationSearchResponse: """ You can search for multiple conversations by the value of their attributes in order to fetch exactly which ones you want. @@ -1688,7 +1688,7 @@ async def search( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ConversationList, + cast_to=ConversationSearchResponse, ) diff --git a/src/python_intercom/types/__init__.py b/src/python_intercom/types/__init__.py index 798a027a..37e28bc5 100644 --- a/src/python_intercom/types/__init__.py +++ b/src/python_intercom/types/__init__.py @@ -51,7 +51,6 @@ from .contact_archived import ContactArchived as ContactArchived from .help_center_list import HelpCenterList as HelpCenterList from .ticket_type_list import TicketTypeList as TicketTypeList -from .conversation_list import ConversationList as ConversationList from .contact_unarchived import ContactUnarchived as ContactUnarchived from .data_event_summary import DataEventSummary as DataEventSummary from .company_list_params import CompanyListParams as CompanyListParams @@ -94,6 +93,7 @@ from .tag_create_or_update_params import TagCreateOrUpdateParams as TagCreateOrUpdateParams from .company_retrieve_list_params import CompanyRetrieveListParams as CompanyRetrieveListParams from .conversation_retrieve_params import ConversationRetrieveParams as ConversationRetrieveParams +from .conversation_search_response import ConversationSearchResponse as ConversationSearchResponse from .data_attribute_create_params import DataAttributeCreateParams as DataAttributeCreateParams from .data_attribute_update_params import DataAttributeUpdateParams as DataAttributeUpdateParams from .data_export_content_data_params import DataExportContentDataParams as DataExportContentDataParams diff --git a/src/python_intercom/types/conversation_list.py b/src/python_intercom/types/conversation_search_response.py similarity index 91% rename from src/python_intercom/types/conversation_list.py rename to src/python_intercom/types/conversation_search_response.py index fdbaef93..9b2ac476 100644 --- a/src/python_intercom/types/conversation_list.py +++ b/src/python_intercom/types/conversation_search_response.py @@ -7,10 +7,10 @@ from .shared.conversation import Conversation from .shared.cursor_pages import CursorPages -__all__ = ["ConversationList"] +__all__ = ["ConversationSearchResponse"] -class ConversationList(BaseModel): +class ConversationSearchResponse(BaseModel): conversations: Optional[List[Conversation]] = None """The list of conversation objects""" diff --git a/tests/api_resources/test_conversations.py b/tests/api_resources/test_conversations.py index 38078f0e..18354405 100644 --- a/tests/api_resources/test_conversations.py +++ b/tests/api_resources/test_conversations.py @@ -10,8 +10,8 @@ from tests.utils import assert_matches_type from python_intercom import Intercom, AsyncIntercom from python_intercom.types import ( - ConversationList, ConversationListResponse, + ConversationSearchResponse, ) from python_intercom.pagination import SyncCursorPagination, AsyncCursorPagination from python_intercom.types.shared import Ticket, Message, Conversation @@ -342,7 +342,7 @@ def test_method_search(self, client: Intercom) -> None: conversation = client.conversations.search( query={}, ) - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) @parametrize 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: }, intercom_version="2.11", ) - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) @parametrize def test_raw_response_search(self, client: Intercom) -> None: @@ -369,7 +369,7 @@ def test_raw_response_search(self, client: Intercom) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" conversation = response.parse() - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) @parametrize def test_streaming_response_search(self, client: Intercom) -> None: @@ -380,7 +380,7 @@ def test_streaming_response_search(self, client: Intercom) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" conversation = response.parse() - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -708,7 +708,7 @@ async def test_method_search(self, async_client: AsyncIntercom) -> None: conversation = await async_client.conversations.search( query={}, ) - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) @parametrize 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) }, intercom_version="2.11", ) - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) @parametrize 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: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" conversation = await response.parse() - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) @parametrize 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 assert response.http_request.headers.get("X-Stainless-Lang") == "python" conversation = await response.parse() - assert_matches_type(ConversationList, conversation, path=["response"]) + assert_matches_type(ConversationSearchResponse, conversation, path=["response"]) assert cast(Any, response.is_closed) is True