Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 4.0.0-alpha.2 #260

Open
wants to merge 14 commits into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.0.0-alpha.1"
".": "4.0.0-alpha.2"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 python-intercom==4.0.0a1
```

## Usage
Expand Down
21 changes: 13 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ from python_intercom.types import (
Message,
MultipleFilterSearchRequest,
Note,
PaginatedResponse,
PartAttachment,
Reference,
SearchRequest,
Expand Down Expand Up @@ -243,7 +242,7 @@ Methods:
Types:

```python
from python_intercom.types import ConversationList, ConversationListResponse
from python_intercom.types import ConversationListResponse, ConversationSearchResponse
```

Methods:
Expand All @@ -254,7 +253,7 @@ Methods:
- <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>
- <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>
- <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>
- <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>
- <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>

## Tags

Expand Down Expand Up @@ -365,35 +364,41 @@ Methods:
Types:

```python
from python_intercom.types.news import NewsItem, NewsItemDeleteResponse
from python_intercom.types.news import NewsItem, NewsItemListResponse, NewsItemDeleteResponse
```

Methods:

- <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>
- <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>
- <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>
- <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>
- <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>
- <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>

## Newsfeeds

Types:

```python
from python_intercom.types.news import Newsfeed
from python_intercom.types.news import Newsfeed, NewsfeedListResponse
```

Methods:

- <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>
- <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>
- <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>

### Items

Types:

```python
from python_intercom.types.news.newsfeeds import ItemListResponse
```

Methods:

- <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>
- <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>

# Notes

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].4 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
echo -n "Waiting for server"
Expand All @@ -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/[email protected].4 -- prism mock "$URL"
fi
2 changes: 1 addition & 1 deletion src/python_intercom/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions src/python_intercom/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/python_intercom/_version.py
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions src/python_intercom/resources/conversations/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
)


Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
)


Expand Down
10 changes: 5 additions & 5 deletions src/python_intercom/resources/news/news_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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

Expand All @@ -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(
Expand Down Expand Up @@ -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

Expand All @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions src/python_intercom/resources/news/newsfeeds/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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

Expand All @@ -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,
)


Expand Down Expand Up @@ -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

Expand All @@ -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,
)


Expand Down
10 changes: 5 additions & 5 deletions src/python_intercom/resources/news/newsfeeds/newsfeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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

Expand All @@ -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,
)


Expand Down Expand Up @@ -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

Expand All @@ -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,
)


Expand Down
3 changes: 1 addition & 2 deletions src/python_intercom/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -51,7 +50,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
Expand Down Expand Up @@ -94,6 +92,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down
Loading
Loading