Skip to content

Commit cd48024

Browse files
committed
feat(api): update via SDK Studio
1 parent dfd8fba commit cd48024

File tree

5 files changed

+39
-41
lines changed

5 files changed

+39
-41
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 108
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-52f67643df9a7d7b1390beca7892a18bd840aaedd848c5f8ee79d9fd9a666c99.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-74554ca4b1e947254782b93352448c7a35a528fc0f88e9686e91f77e682b1669.yml

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ from intercom.types.contacts import ContactAttachedCompanies
181181

182182
Methods:
183183

184-
- <code title="post /contacts/{id}/companies">client.contacts.companies.<a href="./src/intercom/resources/contacts/companies.py">create</a>(\*, path_id, \*\*<a href="src/intercom/types/contacts/company_create_params.py">params</a>) -> <a href="./src/intercom/types/shared/company.py">Company</a></code>
184+
- <code title="post /contacts/{id}/companies">client.contacts.companies.<a href="./src/intercom/resources/contacts/companies.py">create</a>(id, \*\*<a href="src/intercom/types/contacts/company_create_params.py">params</a>) -> <a href="./src/intercom/types/shared/company.py">Company</a></code>
185185
- <code title="get /contacts/{id}/companies">client.contacts.companies.<a href="./src/intercom/resources/contacts/companies.py">list</a>(id) -> <a href="./src/intercom/types/contacts/contact_attached_companies.py">ContactAttachedCompanies</a></code>
186186
- <code title="delete /contacts/{contact_id}/companies/{id}">client.contacts.companies.<a href="./src/intercom/resources/contacts/companies.py">delete</a>(id, \*, contact_id) -> <a href="./src/intercom/types/shared/company.py">Company</a></code>
187187

src/intercom/resources/contacts/companies.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def with_streaming_response(self) -> CompaniesResourceWithStreamingResponse:
4141

4242
def create(
4343
self,
44+
id: str,
4445
*,
45-
path_id: str,
46-
body_id: str,
46+
company_id: str,
4747
intercom_version: Literal[
4848
"1.0",
4949
"1.1",
@@ -76,7 +76,7 @@ def create(
7676
You can attach a company to a single contact.
7777
7878
Args:
79-
body_id: The unique identifier for the company which is given by Intercom
79+
company_id: The unique identifier for the company which is given by Intercom
8080
8181
intercom_version: Intercom API version.By default, it's equal to the version set in the app
8282
package.
@@ -89,12 +89,12 @@ def create(
8989
9090
timeout: Override the client-level default timeout for this request, in seconds
9191
"""
92-
if not path_id:
93-
raise ValueError(f"Expected a non-empty value for `path_id` but received {path_id!r}")
92+
if not id:
93+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
9494
extra_headers = {**strip_not_given({"Intercom-Version": str(intercom_version)}), **(extra_headers or {})}
9595
return self._post(
96-
f"/contacts/{path_id}/companies",
97-
body=maybe_transform({"id": body_id}, company_create_params.CompanyCreateParams),
96+
f"/contacts/{id}/companies",
97+
body=maybe_transform({"id": company_id}, company_create_params.CompanyCreateParams),
9898
options=make_request_options(
9999
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
100100
),
@@ -232,9 +232,9 @@ def with_streaming_response(self) -> AsyncCompaniesResourceWithStreamingResponse
232232

233233
async def create(
234234
self,
235+
id: str,
235236
*,
236-
path_id: str,
237-
body_id: str,
237+
company_id: str,
238238
intercom_version: Literal[
239239
"1.0",
240240
"1.1",
@@ -267,7 +267,7 @@ async def create(
267267
You can attach a company to a single contact.
268268
269269
Args:
270-
body_id: The unique identifier for the company which is given by Intercom
270+
company_id: The unique identifier for the company which is given by Intercom
271271
272272
intercom_version: Intercom API version.By default, it's equal to the version set in the app
273273
package.
@@ -280,12 +280,12 @@ async def create(
280280
281281
timeout: Override the client-level default timeout for this request, in seconds
282282
"""
283-
if not path_id:
284-
raise ValueError(f"Expected a non-empty value for `path_id` but received {path_id!r}")
283+
if not id:
284+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
285285
extra_headers = {**strip_not_given({"Intercom-Version": str(intercom_version)}), **(extra_headers or {})}
286286
return await self._post(
287-
f"/contacts/{path_id}/companies",
288-
body=await async_maybe_transform({"id": body_id}, company_create_params.CompanyCreateParams),
287+
f"/contacts/{id}/companies",
288+
body=await async_maybe_transform({"id": company_id}, company_create_params.CompanyCreateParams),
289289
options=make_request_options(
290290
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
291291
),

src/intercom/types/contacts/company_create_params.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111

1212
class CompanyCreateParams(TypedDict, total=False):
13-
path_id: Required[Annotated[str, PropertyInfo(alias="id")]]
14-
15-
body_id: Required[Annotated[str, PropertyInfo(alias="id")]]
13+
company_id: Required[Annotated[str, PropertyInfo(alias="id")]]
1614
"""The unique identifier for the company which is given by Intercom"""
1715

1816
intercom_version: Annotated[

tests/api_resources/contacts/test_companies.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ class TestCompanies:
2121
@parametrize
2222
def test_method_create(self, client: Intercom) -> None:
2323
company = client.contacts.companies.create(
24-
path_id="string",
25-
body_id="6657add46abd0167d9419cd2",
24+
"string",
25+
company_id="6657add46abd0167d9419cd2",
2626
)
2727
assert_matches_type(Company, company, path=["response"])
2828

2929
@parametrize
3030
def test_method_create_with_all_params(self, client: Intercom) -> None:
3131
company = client.contacts.companies.create(
32-
path_id="string",
33-
body_id="6657add46abd0167d9419cd2",
32+
"string",
33+
company_id="6657add46abd0167d9419cd2",
3434
intercom_version="2.11",
3535
)
3636
assert_matches_type(Company, company, path=["response"])
3737

3838
@parametrize
3939
def test_raw_response_create(self, client: Intercom) -> None:
4040
response = client.contacts.companies.with_raw_response.create(
41-
path_id="string",
42-
body_id="6657add46abd0167d9419cd2",
41+
"string",
42+
company_id="6657add46abd0167d9419cd2",
4343
)
4444

4545
assert response.is_closed is True
@@ -50,8 +50,8 @@ def test_raw_response_create(self, client: Intercom) -> None:
5050
@parametrize
5151
def test_streaming_response_create(self, client: Intercom) -> None:
5252
with client.contacts.companies.with_streaming_response.create(
53-
path_id="string",
54-
body_id="6657add46abd0167d9419cd2",
53+
"string",
54+
company_id="6657add46abd0167d9419cd2",
5555
) as response:
5656
assert not response.is_closed
5757
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -63,10 +63,10 @@ def test_streaming_response_create(self, client: Intercom) -> None:
6363

6464
@parametrize
6565
def test_path_params_create(self, client: Intercom) -> None:
66-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_id` but received ''"):
66+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
6767
client.contacts.companies.with_raw_response.create(
68-
path_id="",
69-
body_id="",
68+
"",
69+
company_id="",
7070
)
7171

7272
@parametrize
@@ -179,25 +179,25 @@ class TestAsyncCompanies:
179179
@parametrize
180180
async def test_method_create(self, async_client: AsyncIntercom) -> None:
181181
company = await async_client.contacts.companies.create(
182-
path_id="string",
183-
body_id="6657add46abd0167d9419cd2",
182+
"string",
183+
company_id="6657add46abd0167d9419cd2",
184184
)
185185
assert_matches_type(Company, company, path=["response"])
186186

187187
@parametrize
188188
async def test_method_create_with_all_params(self, async_client: AsyncIntercom) -> None:
189189
company = await async_client.contacts.companies.create(
190-
path_id="string",
191-
body_id="6657add46abd0167d9419cd2",
190+
"string",
191+
company_id="6657add46abd0167d9419cd2",
192192
intercom_version="2.11",
193193
)
194194
assert_matches_type(Company, company, path=["response"])
195195

196196
@parametrize
197197
async def test_raw_response_create(self, async_client: AsyncIntercom) -> None:
198198
response = await async_client.contacts.companies.with_raw_response.create(
199-
path_id="string",
200-
body_id="6657add46abd0167d9419cd2",
199+
"string",
200+
company_id="6657add46abd0167d9419cd2",
201201
)
202202

203203
assert response.is_closed is True
@@ -208,8 +208,8 @@ async def test_raw_response_create(self, async_client: AsyncIntercom) -> None:
208208
@parametrize
209209
async def test_streaming_response_create(self, async_client: AsyncIntercom) -> None:
210210
async with async_client.contacts.companies.with_streaming_response.create(
211-
path_id="string",
212-
body_id="6657add46abd0167d9419cd2",
211+
"string",
212+
company_id="6657add46abd0167d9419cd2",
213213
) as response:
214214
assert not response.is_closed
215215
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -221,10 +221,10 @@ async def test_streaming_response_create(self, async_client: AsyncIntercom) -> N
221221

222222
@parametrize
223223
async def test_path_params_create(self, async_client: AsyncIntercom) -> None:
224-
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_id` but received ''"):
224+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
225225
await async_client.contacts.companies.with_raw_response.create(
226-
path_id="",
227-
body_id="",
226+
"",
227+
company_id="",
228228
)
229229

230230
@parametrize

0 commit comments

Comments
 (0)