From 10e190128e63b17011af01bb5b0d927d6977809c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:12:03 +0000 Subject: [PATCH 01/14] chore(internal): version bump (#259) --- README.md | 2 +- bin/check-release-environment | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62f1b294..1c720e85 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The REST API documentation can be found on [developers.intercom.com](https://dev ```sh # install from PyPI -pip install python-intercom +pip install --pre python-intercom ``` ## Usage 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[@]} From b78c4f0ac7ee4a571d0be0c08b313bce3134a019 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:14:07 +0000 Subject: [PATCH 02/14] chore(internal): refactor release doctor script (#261) --- bin/check-release-environment | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index b99d829c..688f9f7e 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -1,20 +1,9 @@ #!/usr/bin/env bash -warnings=() errors=() if [ -z "${PYPI_TOKEN}" ]; then - 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 + errors+=("The INTERCOM_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} From 229a17ad3b474dd230561a3dcf2eaf19f7189c20 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:15:40 +0000 Subject: [PATCH 03/14] chore(tests): update prism version (#262) --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index fe89a1d0..f5861576 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" fi From c7a1a2f2c99c4f550d92e6b5e2170f2b5e734ea2 Mon Sep 17 00:00:00 2001 From: Liz Moy Date: Tue, 23 Jul 2024 15:25:16 +0100 Subject: [PATCH 04/14] chore: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c720e85..7df85c33 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The REST API documentation can be found on [developers.intercom.com](https://dev ```sh # install from PyPI -pip install --pre python-intercom +pip install python-intercom==4.0.0a1 ``` ## Usage From 35af217c3ce6fb0ac47aa0ecde8a08a99b4819ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:51:29 +0000 Subject: [PATCH 05/14] feat(api): update via SDK Studio (#263) --- .stats.yml | 2 +- bin/check-release-environment | 13 ++++++++++++- scripts/mock | 4 ++-- tests/api_resources/contacts/test_companies.py | 16 ++++++++-------- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.stats.yml b/.stats.yml index 75bc5ebf..d3cca5f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 108 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-61fd2f21fb0fb6a94c5e87ea423d828bf37d1dd90ca1511eda9b91d58ccb5d39.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-a52cc0e4313a38d4329e6c2f40afa341d800389762fc643b9bf5b13248f8c5da.yml 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/scripts/mock b/scripts/mock index f5861576..fe89a1d0 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" + npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" fi diff --git a/tests/api_resources/contacts/test_companies.py b/tests/api_resources/contacts/test_companies.py index 71a0abab..9dab6c9a 100644 --- a/tests/api_resources/contacts/test_companies.py +++ b/tests/api_resources/contacts/test_companies.py @@ -72,14 +72,14 @@ def test_path_params_create(self, client: Intercom) -> None: @parametrize def test_method_list(self, client: Intercom) -> None: company = client.contacts.companies.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", ) assert_matches_type(ContactAttachedCompanies, company, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Intercom) -> None: company = client.contacts.companies.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", intercom_version="2.11", ) assert_matches_type(ContactAttachedCompanies, company, path=["response"]) @@ -87,7 +87,7 @@ def test_method_list_with_all_params(self, client: Intercom) -> None: @parametrize def test_raw_response_list(self, client: Intercom) -> None: response = client.contacts.companies.with_raw_response.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", ) assert response.is_closed is True @@ -98,7 +98,7 @@ def test_raw_response_list(self, client: Intercom) -> None: @parametrize def test_streaming_response_list(self, client: Intercom) -> None: with client.contacts.companies.with_streaming_response.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -230,14 +230,14 @@ async def test_path_params_create(self, async_client: AsyncIntercom) -> None: @parametrize async def test_method_list(self, async_client: AsyncIntercom) -> None: company = await async_client.contacts.companies.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", ) assert_matches_type(ContactAttachedCompanies, company, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncIntercom) -> None: company = await async_client.contacts.companies.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", intercom_version="2.11", ) assert_matches_type(ContactAttachedCompanies, company, path=["response"]) @@ -245,7 +245,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncIntercom) -> @parametrize async def test_raw_response_list(self, async_client: AsyncIntercom) -> None: response = await async_client.contacts.companies.with_raw_response.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", ) assert response.is_closed is True @@ -256,7 +256,7 @@ async def test_raw_response_list(self, async_client: AsyncIntercom) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncIntercom) -> None: async with async_client.contacts.companies.with_streaming_response.list( - contact_id="contact_id", + contact_id="63a07ddf05a32042dffac965", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From 81453cea53317789d7fff13c8c68509f6f700462 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:53:31 +0000 Subject: [PATCH 06/14] chore(internal): refactor release doctor script (#264) --- bin/check-release-environment | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index b99d829c..688f9f7e 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -1,20 +1,9 @@ #!/usr/bin/env bash -warnings=() errors=() if [ -z "${PYPI_TOKEN}" ]; then - 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 + errors+=("The INTERCOM_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} From bcc28f659e15461bf4b0308720e5cac7b088f273 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:45:09 +0000 Subject: [PATCH 07/14] feat(api): update via SDK Studio (#265) --- api.md | 4 ++-- bin/check-release-environment | 13 ++++++++++++- .../resources/conversations/conversations.py | 10 +++++----- src/python_intercom/types/__init__.py | 2 +- ...list.py => conversation_search_response.py} | 4 ++-- tests/api_resources/test_conversations.py | 18 +++++++++--------- 6 files changed, 31 insertions(+), 20 deletions(-) rename src/python_intercom/types/{conversation_list.py => conversation_search_response.py} (91%) 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 From 276360c3cad7c86e0629b4762f8c3e8469894e01 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:45:38 +0000 Subject: [PATCH 08/14] chore(internal): refactor release doctor script (#266) --- bin/check-release-environment | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index b99d829c..688f9f7e 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -1,20 +1,9 @@ #!/usr/bin/env bash -warnings=() errors=() if [ -z "${PYPI_TOKEN}" ]; then - 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 + errors+=("The INTERCOM_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} From fbcc2c373d0b7147f7fb92d3026226713ebb9b90 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:47:08 +0000 Subject: [PATCH 09/14] chore(tests): update prism version (#267) --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index fe89a1d0..f5861576 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" fi From 13ea06f33714036c77082340858ce2207a5854e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:50:30 +0000 Subject: [PATCH 10/14] chore: fix error message import example (#268) --- src/python_intercom/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_intercom/_base_client.py b/src/python_intercom/_base_client.py index f1d16835..32b776d4 100644 --- a/src/python_intercom/_base_client.py +++ b/src/python_intercom/_base_client.py @@ -363,7 +363,7 @@ def __init__( if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] raise TypeError( - "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `python-intercom.DEFAULT_MAX_RETRIES`" + "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `python_intercom.DEFAULT_MAX_RETRIES`" ) def _enforce_trailing_slash(self, url: URL) -> URL: From 5c0b8a60732430e13cc75a2eb02f643b7aca291f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:53:50 +0000 Subject: [PATCH 11/14] chore(internal): codegen related update (#269) --- api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.md b/api.md index 36a70db7..9d1e9f19 100644 --- a/api.md +++ b/api.md @@ -243,7 +243,7 @@ Methods: Types: ```python -from python_intercom.types import Conversation, ConversationListResponse, ConversationSearchResponse +from python_intercom.types import ConversationListResponse, ConversationSearchResponse ``` Methods: From 038341c1f602021861754f1c5a75d4b284192885 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:55:04 +0000 Subject: [PATCH 12/14] chore(internal): add type construction helper (#270) --- src/python_intercom/_models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/python_intercom/_models.py b/src/python_intercom/_models.py index eb7ce3bd..5148d5a7 100644 --- a/src/python_intercom/_models.py +++ b/src/python_intercom/_models.py @@ -406,6 +406,15 @@ def build( return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs)) +def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T: + """Loose coercion to the expected type with construction of nested values. + + Note: the returned value from this function is not guaranteed to match the + given type. + """ + return cast(_T, construct_type(value=value, type_=type_)) + + def construct_type(*, value: object, type_: object) -> object: """Loose coercion to the expected type with construction of nested values. From c29da7803e93ca8046292a8036b0000767c0fd29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:09:58 +0000 Subject: [PATCH 13/14] feat(api): update via SDK Studio (#271) --- api.md | 17 ++++++---- .../resources/news/news_items.py | 10 +++--- .../resources/news/newsfeeds/items.py | 10 +++--- .../resources/news/newsfeeds/newsfeeds.py | 10 +++--- src/python_intercom/types/__init__.py | 1 - src/python_intercom/types/news/__init__.py | 2 ++ .../news_item_list_response.py} | 10 +++--- .../types/news/newsfeed_list_response.py | 32 +++++++++++++++++++ .../types/news/newsfeeds/__init__.py | 2 ++ .../news/newsfeeds/item_list_response.py | 32 +++++++++++++++++++ src/python_intercom/types/shared/__init__.py | 1 - .../news/newsfeeds/test_items.py | 18 +++++------ tests/api_resources/news/test_news_items.py | 18 +++++------ tests/api_resources/news/test_newsfeeds.py | 19 ++++++----- 14 files changed, 126 insertions(+), 56 deletions(-) rename src/python_intercom/types/{shared/paginated_response.py => news/news_item_list_response.py} (81%) create mode 100644 src/python_intercom/types/news/newsfeed_list_response.py create mode 100644 src/python_intercom/types/news/newsfeeds/item_list_response.py diff --git a/api.md b/api.md index 9d1e9f19..edb09daa 100644 --- a/api.md +++ b/api.md @@ -15,7 +15,6 @@ from python_intercom.types import ( Message, MultipleFilterSearchRequest, Note, - PaginatedResponse, PartAttachment, Reference, SearchRequest, @@ -365,7 +364,7 @@ Methods: Types: ```python -from python_intercom.types.news import NewsItem, NewsItemDeleteResponse +from python_intercom.types.news import NewsItem, NewsItemListResponse, NewsItemDeleteResponse ``` Methods: @@ -373,7 +372,7 @@ Methods: - client.news.news_items.create(\*\*params) -> NewsItem - client.news.news_items.retrieve(id) -> NewsItem - client.news.news_items.update(id, \*\*params) -> NewsItem -- client.news.news_items.list() -> PaginatedResponse +- client.news.news_items.list() -> NewsItemListResponse - client.news.news_items.delete(id) -> NewsItemDeleteResponse ## Newsfeeds @@ -381,19 +380,25 @@ Methods: Types: ```python -from python_intercom.types.news import Newsfeed +from python_intercom.types.news import Newsfeed, NewsfeedListResponse ``` Methods: - client.news.newsfeeds.retrieve(id) -> Newsfeed -- client.news.newsfeeds.list() -> PaginatedResponse +- client.news.newsfeeds.list() -> NewsfeedListResponse ### Items +Types: + +```python +from python_intercom.types.news.newsfeeds import ItemListResponse +``` + Methods: -- client.news.newsfeeds.items.list(id) -> PaginatedResponse +- client.news.newsfeeds.items.list(id) -> ItemListResponse # Notes diff --git a/src/python_intercom/resources/news/news_items.py b/src/python_intercom/resources/news/news_items.py index b346eb33..a58f2f7a 100644 --- a/src/python_intercom/resources/news/news_items.py +++ b/src/python_intercom/resources/news/news_items.py @@ -25,7 +25,7 @@ from ...types.news import news_item_create_params, news_item_update_params from ..._base_client import make_request_options from ...types.news.news_item import NewsItem -from ...types.shared.paginated_response import PaginatedResponse +from ...types.news.news_item_list_response import NewsItemListResponse from ...types.news.news_item_delete_response import NewsItemDeleteResponse __all__ = ["NewsItemsResource", "AsyncNewsItemsResource"] @@ -327,7 +327,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PaginatedResponse: + ) -> NewsItemListResponse: """ You can fetch a list of all news items @@ -352,7 +352,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PaginatedResponse, + cast_to=NewsItemListResponse, ) def delete( @@ -711,7 +711,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PaginatedResponse: + ) -> NewsItemListResponse: """ You can fetch a list of all news items @@ -736,7 +736,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PaginatedResponse, + cast_to=NewsItemListResponse, ) async def delete( diff --git a/src/python_intercom/resources/news/newsfeeds/items.py b/src/python_intercom/resources/news/newsfeeds/items.py index 63175b30..571ee207 100644 --- a/src/python_intercom/resources/news/newsfeeds/items.py +++ b/src/python_intercom/resources/news/newsfeeds/items.py @@ -17,7 +17,7 @@ async_to_streamed_response_wrapper, ) from ...._base_client import make_request_options -from ....types.shared.paginated_response import PaginatedResponse +from ....types.news.newsfeeds.item_list_response import ItemListResponse __all__ = ["ItemsResource", "AsyncItemsResource"] @@ -62,7 +62,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PaginatedResponse: + ) -> ItemListResponse: """ You can fetch a list of all news items that are live on a given newsfeed @@ -89,7 +89,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PaginatedResponse, + cast_to=ItemListResponse, ) @@ -133,7 +133,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PaginatedResponse: + ) -> ItemListResponse: """ You can fetch a list of all news items that are live on a given newsfeed @@ -160,7 +160,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PaginatedResponse, + cast_to=ItemListResponse, ) diff --git a/src/python_intercom/resources/news/newsfeeds/newsfeeds.py b/src/python_intercom/resources/news/newsfeeds/newsfeeds.py index ffcd4985..ed398314 100644 --- a/src/python_intercom/resources/news/newsfeeds/newsfeeds.py +++ b/src/python_intercom/resources/news/newsfeeds/newsfeeds.py @@ -26,7 +26,7 @@ ) from ...._base_client import make_request_options from ....types.news.newsfeed import Newsfeed -from ....types.shared.paginated_response import PaginatedResponse +from ....types.news.newsfeed_list_response import NewsfeedListResponse __all__ = ["NewsfeedsResource", "AsyncNewsfeedsResource"] @@ -135,7 +135,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PaginatedResponse: + ) -> NewsfeedListResponse: """ You can fetch a list of all newsfeeds @@ -160,7 +160,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PaginatedResponse, + cast_to=NewsfeedListResponse, ) @@ -268,7 +268,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PaginatedResponse: + ) -> NewsfeedListResponse: """ You can fetch a list of all newsfeeds @@ -293,7 +293,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PaginatedResponse, + cast_to=NewsfeedListResponse, ) diff --git a/src/python_intercom/types/__init__.py b/src/python_intercom/types/__init__.py index 37e28bc5..a0f68036 100644 --- a/src/python_intercom/types/__init__.py +++ b/src/python_intercom/types/__init__.py @@ -20,7 +20,6 @@ ArticleContent as ArticleContent, PartAttachment as PartAttachment, ContactReference as ContactReference, - PaginatedResponse as PaginatedResponse, StartingAfterPaging as StartingAfterPaging, TicketTypeAttribute as TicketTypeAttribute, SubscriptionTypeList as SubscriptionTypeList, diff --git a/src/python_intercom/types/news/__init__.py b/src/python_intercom/types/news/__init__.py index 41c0fea4..cb408518 100644 --- a/src/python_intercom/types/news/__init__.py +++ b/src/python_intercom/types/news/__init__.py @@ -4,6 +4,8 @@ from .newsfeed import Newsfeed as Newsfeed from .news_item import NewsItem as NewsItem +from .newsfeed_list_response import NewsfeedListResponse as NewsfeedListResponse from .news_item_create_params import NewsItemCreateParams as NewsItemCreateParams +from .news_item_list_response import NewsItemListResponse as NewsItemListResponse from .news_item_update_params import NewsItemUpdateParams as NewsItemUpdateParams from .news_item_delete_response import NewsItemDeleteResponse as NewsItemDeleteResponse diff --git a/src/python_intercom/types/shared/paginated_response.py b/src/python_intercom/types/news/news_item_list_response.py similarity index 81% rename from src/python_intercom/types/shared/paginated_response.py rename to src/python_intercom/types/news/news_item_list_response.py index bc025b53..4cb5b729 100644 --- a/src/python_intercom/types/shared/paginated_response.py +++ b/src/python_intercom/types/news/news_item_list_response.py @@ -3,17 +3,17 @@ from typing import List, Union, Optional from typing_extensions import Literal +from .newsfeed import Newsfeed from ..._models import BaseModel -from .cursor_pages import CursorPages -from ..news.newsfeed import Newsfeed -from ..news.news_item import NewsItem +from .news_item import NewsItem +from ..shared.cursor_pages import CursorPages -__all__ = ["PaginatedResponse", "Data"] +__all__ = ["NewsItemListResponse", "Data"] Data = Union[NewsItem, Newsfeed] -class PaginatedResponse(BaseModel): +class NewsItemListResponse(BaseModel): data: Optional[List[Data]] = None """An array of Objects""" diff --git a/src/python_intercom/types/news/newsfeed_list_response.py b/src/python_intercom/types/news/newsfeed_list_response.py new file mode 100644 index 00000000..170dd1ff --- /dev/null +++ b/src/python_intercom/types/news/newsfeed_list_response.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal + +from .newsfeed import Newsfeed +from ..._models import BaseModel +from .news_item import NewsItem +from ..shared.cursor_pages import CursorPages + +__all__ = ["NewsfeedListResponse", "Data"] + +Data = Union[NewsItem, Newsfeed] + + +class NewsfeedListResponse(BaseModel): + data: Optional[List[Data]] = None + """An array of Objects""" + + pages: Optional[CursorPages] = None + """ + Cursor-based pagination is a technique used in the Intercom API to navigate + through large amounts of data. A "cursor" or pointer is used to keep track of + the current position in the result set, allowing the API to return the data in + small chunks or "pages" as needed. + """ + + total_count: Optional[int] = None + """A count of the total number of objects.""" + + type: Optional[Literal["list", "conversation.list"]] = None + """The type of object""" diff --git a/src/python_intercom/types/news/newsfeeds/__init__.py b/src/python_intercom/types/news/newsfeeds/__init__.py index f8ee8b14..93502d4f 100644 --- a/src/python_intercom/types/news/newsfeeds/__init__.py +++ b/src/python_intercom/types/news/newsfeeds/__init__.py @@ -1,3 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations + +from .item_list_response import ItemListResponse as ItemListResponse diff --git a/src/python_intercom/types/news/newsfeeds/item_list_response.py b/src/python_intercom/types/news/newsfeeds/item_list_response.py new file mode 100644 index 00000000..4e2d7f31 --- /dev/null +++ b/src/python_intercom/types/news/newsfeeds/item_list_response.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal + +from ..newsfeed import Newsfeed +from ...._models import BaseModel +from ..news_item import NewsItem +from ...shared.cursor_pages import CursorPages + +__all__ = ["ItemListResponse", "Data"] + +Data = Union[NewsItem, Newsfeed] + + +class ItemListResponse(BaseModel): + data: Optional[List[Data]] = None + """An array of Objects""" + + pages: Optional[CursorPages] = None + """ + Cursor-based pagination is a technique used in the Intercom API to navigate + through large amounts of data. A "cursor" or pointer is used to keep track of + the current position in the result set, allowing the API to return the data in + small chunks or "pages" as needed. + """ + + total_count: Optional[int] = None + """A count of the total number of objects.""" + + type: Optional[Literal["list", "conversation.list"]] = None + """The type of object""" diff --git a/src/python_intercom/types/shared/__init__.py b/src/python_intercom/types/shared/__init__.py index e5fe0d4f..4a029fbe 100644 --- a/src/python_intercom/types/shared/__init__.py +++ b/src/python_intercom/types/shared/__init__.py @@ -16,7 +16,6 @@ from .article_content import ArticleContent as ArticleContent from .part_attachment import PartAttachment as PartAttachment from .contact_reference import ContactReference as ContactReference -from .paginated_response import PaginatedResponse as PaginatedResponse from .starting_after_paging import StartingAfterPaging as StartingAfterPaging from .ticket_type_attribute import TicketTypeAttribute as TicketTypeAttribute from .subscription_type_list import SubscriptionTypeList as SubscriptionTypeList diff --git a/tests/api_resources/news/newsfeeds/test_items.py b/tests/api_resources/news/newsfeeds/test_items.py index 8bb85891..80926b94 100644 --- a/tests/api_resources/news/newsfeeds/test_items.py +++ b/tests/api_resources/news/newsfeeds/test_items.py @@ -9,7 +9,7 @@ from tests.utils import assert_matches_type from python_intercom import Intercom, AsyncIntercom -from python_intercom.types.shared import PaginatedResponse +from python_intercom.types.news.newsfeeds import ItemListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_list(self, client: Intercom) -> None: item = client.news.newsfeeds.items.list( id="123", ) - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Intercom) -> None: @@ -30,7 +30,7 @@ def test_method_list_with_all_params(self, client: Intercom) -> None: id="123", intercom_version="2.11", ) - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) @parametrize def test_raw_response_list(self, client: Intercom) -> None: @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Intercom) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) @parametrize def test_streaming_response_list(self, client: Intercom) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_list(self, client: Intercom) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +72,7 @@ async def test_method_list(self, async_client: AsyncIntercom) -> None: item = await async_client.news.newsfeeds.items.list( id="123", ) - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncIntercom) -> None: @@ -80,7 +80,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncIntercom) -> id="123", intercom_version="2.11", ) - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) @parametrize 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: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) @parametrize 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 assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(PaginatedResponse, item, path=["response"]) + assert_matches_type(ItemListResponse, item, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/news/test_news_items.py b/tests/api_resources/news/test_news_items.py index 4b8b5cca..9a2a39f0 100644 --- a/tests/api_resources/news/test_news_items.py +++ b/tests/api_resources/news/test_news_items.py @@ -11,9 +11,9 @@ from python_intercom import Intercom, AsyncIntercom from python_intercom.types.news import ( NewsItem, + NewsItemListResponse, NewsItemDeleteResponse, ) -from python_intercom.types.shared import PaginatedResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -183,14 +183,14 @@ def test_streaming_response_update(self, client: Intercom) -> None: @parametrize def test_method_list(self, client: Intercom) -> None: news_item = client.news.news_items.list() - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Intercom) -> None: news_item = client.news.news_items.list( intercom_version="2.11", ) - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) @parametrize def test_raw_response_list(self, client: Intercom) -> None: @@ -199,7 +199,7 @@ def test_raw_response_list(self, client: Intercom) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" news_item = response.parse() - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) @parametrize def test_streaming_response_list(self, client: Intercom) -> None: @@ -208,7 +208,7 @@ def test_streaming_response_list(self, client: Intercom) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" news_item = response.parse() - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -417,14 +417,14 @@ async def test_streaming_response_update(self, async_client: AsyncIntercom) -> N @parametrize async def test_method_list(self, async_client: AsyncIntercom) -> None: news_item = await async_client.news.news_items.list() - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncIntercom) -> None: news_item = await async_client.news.news_items.list( intercom_version="2.11", ) - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncIntercom) -> None: @@ -433,7 +433,7 @@ async def test_raw_response_list(self, async_client: AsyncIntercom) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" news_item = await response.parse() - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncIntercom) -> None: @@ -442,7 +442,7 @@ async def test_streaming_response_list(self, async_client: AsyncIntercom) -> Non assert response.http_request.headers.get("X-Stainless-Lang") == "python" news_item = await response.parse() - assert_matches_type(PaginatedResponse, news_item, path=["response"]) + assert_matches_type(NewsItemListResponse, news_item, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/news/test_newsfeeds.py b/tests/api_resources/news/test_newsfeeds.py index 2db0f22f..f870dc00 100644 --- a/tests/api_resources/news/test_newsfeeds.py +++ b/tests/api_resources/news/test_newsfeeds.py @@ -9,8 +9,7 @@ from tests.utils import assert_matches_type from python_intercom import Intercom, AsyncIntercom -from python_intercom.types.news import Newsfeed -from python_intercom.types.shared import PaginatedResponse +from python_intercom.types.news import Newsfeed, NewsfeedListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -67,14 +66,14 @@ def test_path_params_retrieve(self, client: Intercom) -> None: @parametrize def test_method_list(self, client: Intercom) -> None: newsfeed = client.news.newsfeeds.list() - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Intercom) -> None: newsfeed = client.news.newsfeeds.list( intercom_version="2.11", ) - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) @parametrize def test_raw_response_list(self, client: Intercom) -> None: @@ -83,7 +82,7 @@ def test_raw_response_list(self, client: Intercom) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" newsfeed = response.parse() - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) @parametrize def test_streaming_response_list(self, client: Intercom) -> None: @@ -92,7 +91,7 @@ def test_streaming_response_list(self, client: Intercom) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" newsfeed = response.parse() - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,14 +148,14 @@ async def test_path_params_retrieve(self, async_client: AsyncIntercom) -> None: @parametrize async def test_method_list(self, async_client: AsyncIntercom) -> None: newsfeed = await async_client.news.newsfeeds.list() - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncIntercom) -> None: newsfeed = await async_client.news.newsfeeds.list( intercom_version="2.11", ) - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncIntercom) -> None: @@ -165,7 +164,7 @@ async def test_raw_response_list(self, async_client: AsyncIntercom) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" newsfeed = await response.parse() - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncIntercom) -> None: @@ -174,6 +173,6 @@ async def test_streaming_response_list(self, async_client: AsyncIntercom) -> Non assert response.http_request.headers.get("X-Stainless-Lang") == "python" newsfeed = await response.parse() - assert_matches_type(PaginatedResponse, newsfeed, path=["response"]) + assert_matches_type(NewsfeedListResponse, newsfeed, path=["response"]) assert cast(Any, response.is_closed) is True From c91ba8e90b7999d68f40a4a823ab74c02e5dc4af Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:10:14 +0000 Subject: [PATCH 14/14] release: 4.0.0-alpha.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 24 ++++++++++++++++++++++++ pyproject.toml | 2 +- src/python_intercom/_version.py | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f7dc0ced..4ab5d2a0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.0.0-alpha.1" + ".": "4.0.0-alpha.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ac19a05a..d106458a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 4.0.0-alpha.2 (2024-07-30) + +Full Changelog: [v4.0.0-alpha.1...v4.0.0-alpha.2](https://github.com/intercom/python-intercom/compare/v4.0.0-alpha.1...v4.0.0-alpha.2) + +### Features + +* **api:** update via SDK Studio ([#263](https://github.com/intercom/python-intercom/issues/263)) ([35af217](https://github.com/intercom/python-intercom/commit/35af217c3ce6fb0ac47aa0ecde8a08a99b4819ed)) +* **api:** update via SDK Studio ([#265](https://github.com/intercom/python-intercom/issues/265)) ([bcc28f6](https://github.com/intercom/python-intercom/commit/bcc28f659e15461bf4b0308720e5cac7b088f273)) +* **api:** update via SDK Studio ([#271](https://github.com/intercom/python-intercom/issues/271)) ([c29da78](https://github.com/intercom/python-intercom/commit/c29da7803e93ca8046292a8036b0000767c0fd29)) + + +### Chores + +* fix error message import example ([#268](https://github.com/intercom/python-intercom/issues/268)) ([13ea06f](https://github.com/intercom/python-intercom/commit/13ea06f33714036c77082340858ce2207a5854e1)) +* **internal:** add type construction helper ([#270](https://github.com/intercom/python-intercom/issues/270)) ([038341c](https://github.com/intercom/python-intercom/commit/038341c1f602021861754f1c5a75d4b284192885)) +* **internal:** codegen related update ([#269](https://github.com/intercom/python-intercom/issues/269)) ([5c0b8a6](https://github.com/intercom/python-intercom/commit/5c0b8a60732430e13cc75a2eb02f643b7aca291f)) +* **internal:** refactor release doctor script ([#261](https://github.com/intercom/python-intercom/issues/261)) ([b78c4f0](https://github.com/intercom/python-intercom/commit/b78c4f0ac7ee4a571d0be0c08b313bce3134a019)) +* **internal:** refactor release doctor script ([#264](https://github.com/intercom/python-intercom/issues/264)) ([81453ce](https://github.com/intercom/python-intercom/commit/81453cea53317789d7fff13c8c68509f6f700462)) +* **internal:** refactor release doctor script ([#266](https://github.com/intercom/python-intercom/issues/266)) ([276360c](https://github.com/intercom/python-intercom/commit/276360c3cad7c86e0629b4762f8c3e8469894e01)) +* **internal:** version bump ([#259](https://github.com/intercom/python-intercom/issues/259)) ([10e1901](https://github.com/intercom/python-intercom/commit/10e190128e63b17011af01bb5b0d927d6977809c)) +* **tests:** update prism version ([#262](https://github.com/intercom/python-intercom/issues/262)) ([229a17a](https://github.com/intercom/python-intercom/commit/229a17ad3b474dd230561a3dcf2eaf19f7189c20)) +* **tests:** update prism version ([#267](https://github.com/intercom/python-intercom/issues/267)) ([fbcc2c3](https://github.com/intercom/python-intercom/commit/fbcc2c373d0b7147f7fb92d3026226713ebb9b90)) +* Update README.md ([c7a1a2f](https://github.com/intercom/python-intercom/commit/c7a1a2f2c99c4f550d92e6b5e2170f2b5e734ea2)) + ## 4.0.0-alpha.1 (2024-07-19) Full Changelog: [v0.1.0...v4.0.0-alpha.1](https://github.com/intercom/python-intercom/compare/v0.1.0...v4.0.0-alpha.1) diff --git a/pyproject.toml b/pyproject.toml index 0d3aca3b..9e2a20cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "python-intercom" -version = "4.0.0-alpha.1" +version = "4.0.0-alpha.2" description = "The official Python library for the intercom API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/python_intercom/_version.py b/src/python_intercom/_version.py index 21b3bf0a..a418ee2f 100644 --- a/src/python_intercom/_version.py +++ b/src/python_intercom/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "python_intercom" -__version__ = "4.0.0-alpha.1" # x-release-please-version +__version__ = "4.0.0-alpha.2" # x-release-please-version