Skip to content

Commit

Permalink
feat(api): update via SDK Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Jun 21, 2024
1 parent 0bd7ae4 commit dfd8fba
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 54 deletions.
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-8db47de304da2cbdfa6db6fd50025e9d1d4ade3d8e75569120483556b1583be6.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-52f67643df9a7d7b1390beca7892a18bd840aaedd848c5f8ee79d9fd9a666c99.yml
6 changes: 3 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Methods:

- <code title="get /admins/{id}">client.admins.<a href="./src/intercom/resources/admins/admins.py">retrieve</a>(id) -> <a href="./src/intercom/types/shared/admin.py">Optional</a></code>
- <code title="get /admins">client.admins.<a href="./src/intercom/resources/admins/admins.py">list</a>() -> <a href="./src/intercom/types/admin_list.py">AdminList</a></code>
- <code title="put /admins/{id}/away">client.admins.<a href="./src/intercom/resources/admins/admins.py">away</a>(id, \*\*<a href="src/intercom/types/admin_away_params.py">params</a>) -> <a href="./src/intercom/types/shared/admin.py">Optional</a></code>
- <code title="put /admins/{id}/away">client.admins.<a href="./src/intercom/resources/admins/admins.py">set_away</a>(id, \*\*<a href="src/intercom/types/admin_set_away_params.py">params</a>) -> <a href="./src/intercom/types/shared/admin.py">Optional</a></code>

## ActivityLogs

Expand Down Expand Up @@ -85,7 +85,7 @@ Methods:
Types:

```python
from intercom.types.help_center import Collection, CollectionList, DeletedCollectionObject
from intercom.types.help_center import Collection, CollectionList, DeletedCollection
```

Methods:
Expand All @@ -94,7 +94,7 @@ Methods:
- <code title="get /help_center/collections/{id}">client.help_center.collections.<a href="./src/intercom/resources/help_center/collections.py">retrieve</a>(id) -> <a href="./src/intercom/types/help_center/collection.py">Collection</a></code>
- <code title="put /help_center/collections/{id}">client.help_center.collections.<a href="./src/intercom/resources/help_center/collections.py">update</a>(id, \*\*<a href="src/intercom/types/help_center/collection_update_params.py">params</a>) -> <a href="./src/intercom/types/help_center/collection.py">Collection</a></code>
- <code title="get /help_center/collections">client.help_center.collections.<a href="./src/intercom/resources/help_center/collections.py">list</a>() -> <a href="./src/intercom/types/help_center/collection_list.py">CollectionList</a></code>
- <code title="delete /help_center/collections/{id}">client.help_center.collections.<a href="./src/intercom/resources/help_center/collections.py">delete</a>(id) -> <a href="./src/intercom/types/help_center/deleted_collection_object.py">DeletedCollectionObject</a></code>
- <code title="delete /help_center/collections/{id}">client.help_center.collections.<a href="./src/intercom/resources/help_center/collections.py">delete</a>(id) -> <a href="./src/intercom/types/help_center/deleted_collection.py">DeletedCollection</a></code>

## HelpCenters

Expand Down
26 changes: 13 additions & 13 deletions src/intercom/resources/admins/admins.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import httpx

from ...types import admin_away_params
from ...types import admin_set_away_params
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
Expand Down Expand Up @@ -163,7 +163,7 @@ def list(
cast_to=AdminList,
)

def away(
def set_away(
self,
id: int,
*,
Expand Down Expand Up @@ -224,7 +224,7 @@ def away(
"away_mode_enabled": away_mode_enabled,
"away_mode_reassign": away_mode_reassign,
},
admin_away_params.AdminAwayParams,
admin_set_away_params.AdminSetAwayParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand Down Expand Up @@ -357,7 +357,7 @@ async def list(
cast_to=AdminList,
)

async def away(
async def set_away(
self,
id: int,
*,
Expand Down Expand Up @@ -418,7 +418,7 @@ async def away(
"away_mode_enabled": away_mode_enabled,
"away_mode_reassign": away_mode_reassign,
},
admin_away_params.AdminAwayParams,
admin_set_away_params.AdminSetAwayParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand All @@ -437,8 +437,8 @@ def __init__(self, admins: AdminsResource) -> None:
self.list = to_raw_response_wrapper(
admins.list,
)
self.away = to_raw_response_wrapper(
admins.away,
self.set_away = to_raw_response_wrapper(
admins.set_away,
)

@cached_property
Expand All @@ -456,8 +456,8 @@ def __init__(self, admins: AsyncAdminsResource) -> None:
self.list = async_to_raw_response_wrapper(
admins.list,
)
self.away = async_to_raw_response_wrapper(
admins.away,
self.set_away = async_to_raw_response_wrapper(
admins.set_away,
)

@cached_property
Expand All @@ -475,8 +475,8 @@ def __init__(self, admins: AdminsResource) -> None:
self.list = to_streamed_response_wrapper(
admins.list,
)
self.away = to_streamed_response_wrapper(
admins.away,
self.set_away = to_streamed_response_wrapper(
admins.set_away,
)

@cached_property
Expand All @@ -494,8 +494,8 @@ def __init__(self, admins: AsyncAdminsResource) -> None:
self.list = async_to_streamed_response_wrapper(
admins.list,
)
self.away = async_to_streamed_response_wrapper(
admins.away,
self.set_away = async_to_streamed_response_wrapper(
admins.set_away,
)

@cached_property
Expand Down
10 changes: 5 additions & 5 deletions src/intercom/resources/help_center/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from ...types.help_center import collection_create_params, collection_update_params
from ...types.help_center.collection import Collection
from ...types.help_center.collection_list import CollectionList
from ...types.help_center.deleted_collection_object import DeletedCollectionObject
from ...types.help_center.deleted_collection import DeletedCollection

__all__ = ["CollectionsResource", "AsyncCollectionsResource"]

Expand Down Expand Up @@ -358,7 +358,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DeletedCollectionObject:
) -> DeletedCollection:
"""
You can delete a single collection by making a DELETE request to
`https://api.intercom.io/collections/<id>`.
Expand All @@ -381,7 +381,7 @@ def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=DeletedCollectionObject,
cast_to=DeletedCollection,
)


Expand Down Expand Up @@ -710,7 +710,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DeletedCollectionObject:
) -> DeletedCollection:
"""
You can delete a single collection by making a DELETE request to
`https://api.intercom.io/collections/<id>`.
Expand All @@ -733,7 +733,7 @@ async def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=DeletedCollectionObject,
cast_to=DeletedCollection,
)


Expand Down
2 changes: 1 addition & 1 deletion src/intercom/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
from .contact_deleted import ContactDeleted as ContactDeleted
from .contact_archived import ContactArchived as ContactArchived
from .ticket_type_list import TicketTypeList as TicketTypeList
from .admin_away_params import AdminAwayParams as AdminAwayParams
from .conversation_list import ConversationList as ConversationList
from .contact_unarchived import ContactUnarchived as ContactUnarchived
from .data_event_summary import DataEventSummary as DataEventSummary
Expand All @@ -54,6 +53,7 @@
from .contact_merge_params import ContactMergeParams as ContactMergeParams
from .ticket_create_params import TicketCreateParams as TicketCreateParams
from .ticket_search_params import TicketSearchParams as TicketSearchParams
from .admin_set_away_params import AdminSetAwayParams as AdminSetAwayParams
from .article_create_params import ArticleCreateParams as ArticleCreateParams
from .article_search_params import ArticleSearchParams as ArticleSearchParams
from .article_update_params import ArticleUpdateParams as ArticleUpdateParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

from .._utils import PropertyInfo

__all__ = ["AdminAwayParams"]
__all__ = ["AdminSetAwayParams"]


class AdminAwayParams(TypedDict, total=False):
class AdminSetAwayParams(TypedDict, total=False):
away_mode_enabled: Required[bool]
"""Set to "true" to change the status of the admin to away."""

Expand Down
2 changes: 1 addition & 1 deletion src/intercom/types/help_center/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
from .help_center import HelpCenter as HelpCenter
from .collection_list import CollectionList as CollectionList
from .help_center_list import HelpCenterList as HelpCenterList
from .deleted_collection import DeletedCollection as DeletedCollection
from .collection_create_params import CollectionCreateParams as CollectionCreateParams
from .collection_update_params import CollectionUpdateParams as CollectionUpdateParams
from .deleted_collection_object import DeletedCollectionObject as DeletedCollectionObject
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from ..._models import BaseModel

__all__ = ["DeletedCollectionObject"]
__all__ = ["DeletedCollection"]


class DeletedCollectionObject(BaseModel):
class DeletedCollection(BaseModel):
id: Optional[str] = None
"""The unique identifier for the collection which you provided in the URL."""

Expand Down
3 changes: 2 additions & 1 deletion src/intercom/types/shared/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Dict, List, Optional
from typing_extensions import Literal

from .tag import Tag
from ..segment import Segment
from ..._models import BaseModel

Expand All @@ -28,7 +29,7 @@ class Segments(BaseModel):


class Tags(BaseModel):
tags: Optional[List[object]] = None
tags: Optional[List[Tag]] = None

type: Optional[Literal["tag.list"]] = None
"""The type of the object"""
Expand Down
18 changes: 9 additions & 9 deletions tests/api_resources/help_center/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from intercom.types.help_center import (
Collection,
CollectionList,
DeletedCollectionObject,
DeletedCollection,
)

base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
Expand Down Expand Up @@ -557,15 +557,15 @@ def test_method_delete(self, client: Intercom) -> None:
collection = client.help_center.collections.delete(
0,
)
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

@parametrize
def test_method_delete_with_all_params(self, client: Intercom) -> None:
collection = client.help_center.collections.delete(
0,
intercom_version="2.11",
)
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

@parametrize
def test_raw_response_delete(self, client: Intercom) -> None:
Expand All @@ -576,7 +576,7 @@ def test_raw_response_delete(self, client: Intercom) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
collection = response.parse()
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

@parametrize
def test_streaming_response_delete(self, client: Intercom) -> None:
Expand All @@ -587,7 +587,7 @@ def test_streaming_response_delete(self, client: Intercom) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

collection = response.parse()
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -1131,15 +1131,15 @@ async def test_method_delete(self, async_client: AsyncIntercom) -> None:
collection = await async_client.help_center.collections.delete(
0,
)
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

@parametrize
async def test_method_delete_with_all_params(self, async_client: AsyncIntercom) -> None:
collection = await async_client.help_center.collections.delete(
0,
intercom_version="2.11",
)
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

@parametrize
async def test_raw_response_delete(self, async_client: AsyncIntercom) -> None:
Expand All @@ -1150,7 +1150,7 @@ async def test_raw_response_delete(self, async_client: AsyncIntercom) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
collection = await response.parse()
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

@parametrize
async def test_streaming_response_delete(self, async_client: AsyncIntercom) -> None:
Expand All @@ -1161,6 +1161,6 @@ async def test_streaming_response_delete(self, async_client: AsyncIntercom) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

collection = await response.parse()
assert_matches_type(DeletedCollectionObject, collection, path=["response"])
assert_matches_type(DeletedCollection, collection, path=["response"])

assert cast(Any, response.is_closed) is True
32 changes: 16 additions & 16 deletions tests/api_resources/test_admins.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ def test_streaming_response_list(self, client: Intercom) -> None:
assert cast(Any, response.is_closed) is True

@parametrize
def test_method_away(self, client: Intercom) -> None:
admin = client.admins.away(
def test_method_set_away(self, client: Intercom) -> None:
admin = client.admins.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
)
assert_matches_type(Optional[Admin], admin, path=["response"])

@parametrize
def test_method_away_with_all_params(self, client: Intercom) -> None:
admin = client.admins.away(
def test_method_set_away_with_all_params(self, client: Intercom) -> None:
admin = client.admins.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
Expand All @@ -109,8 +109,8 @@ def test_method_away_with_all_params(self, client: Intercom) -> None:
assert_matches_type(Optional[Admin], admin, path=["response"])

@parametrize
def test_raw_response_away(self, client: Intercom) -> None:
response = client.admins.with_raw_response.away(
def test_raw_response_set_away(self, client: Intercom) -> None:
response = client.admins.with_raw_response.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
Expand All @@ -122,8 +122,8 @@ def test_raw_response_away(self, client: Intercom) -> None:
assert_matches_type(Optional[Admin], admin, path=["response"])

@parametrize
def test_streaming_response_away(self, client: Intercom) -> None:
with client.admins.with_streaming_response.away(
def test_streaming_response_set_away(self, client: Intercom) -> None:
with client.admins.with_streaming_response.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
Expand Down Expand Up @@ -212,17 +212,17 @@ async def test_streaming_response_list(self, async_client: AsyncIntercom) -> Non
assert cast(Any, response.is_closed) is True

@parametrize
async def test_method_away(self, async_client: AsyncIntercom) -> None:
admin = await async_client.admins.away(
async def test_method_set_away(self, async_client: AsyncIntercom) -> None:
admin = await async_client.admins.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
)
assert_matches_type(Optional[Admin], admin, path=["response"])

@parametrize
async def test_method_away_with_all_params(self, async_client: AsyncIntercom) -> None:
admin = await async_client.admins.away(
async def test_method_set_away_with_all_params(self, async_client: AsyncIntercom) -> None:
admin = await async_client.admins.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
Expand All @@ -231,8 +231,8 @@ async def test_method_away_with_all_params(self, async_client: AsyncIntercom) ->
assert_matches_type(Optional[Admin], admin, path=["response"])

@parametrize
async def test_raw_response_away(self, async_client: AsyncIntercom) -> None:
response = await async_client.admins.with_raw_response.away(
async def test_raw_response_set_away(self, async_client: AsyncIntercom) -> None:
response = await async_client.admins.with_raw_response.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
Expand All @@ -244,8 +244,8 @@ async def test_raw_response_away(self, async_client: AsyncIntercom) -> None:
assert_matches_type(Optional[Admin], admin, path=["response"])

@parametrize
async def test_streaming_response_away(self, async_client: AsyncIntercom) -> None:
async with async_client.admins.with_streaming_response.away(
async def test_streaming_response_set_away(self, async_client: AsyncIntercom) -> None:
async with async_client.admins.with_streaming_response.set_away(
0,
away_mode_enabled=True,
away_mode_reassign=True,
Expand Down

0 comments on commit dfd8fba

Please sign in to comment.