Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96e2e9c

Browse files
SDK regeneration (#288)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent3aac991 commit96e2e9c

File tree

627 files changed

+41429
-11746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

627 files changed

+41429
-11746
lines changed

‎.fern/metadata.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"cliVersion":"3.0.2",
3+
"generatorName":"fernapi/fern-python-sdk",
4+
"generatorVersion":"4.41.8",
5+
"generatorConfig": {
6+
"client_class_name":"Intercom",
7+
"pydantic_config": {
8+
"skip_validation":true
9+
}
10+
}
11+
}

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name:ci
2-
32
on:[push]
43
jobs:
54
compile:
@@ -10,7 +9,7 @@ jobs:
109
-name:Set up python
1110
uses:actions/setup-python@v4
1211
with:
13-
python-version:3.8
12+
python-version:3.9
1413
-name:Bootstrap poetry
1514
run:|
1615
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
@@ -26,15 +25,15 @@ jobs:
2625
-name:Set up python
2726
uses:actions/setup-python@v4
2827
with:
29-
python-version:3.8
28+
python-version:3.9
3029
-name:Bootstrap poetry
3130
run:|
3231
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
3332
-name:Install dependencies
3433
run:poetry install
3534

3635
-name:Test
37-
run:poetry run pytest -rP .
36+
run:poetry run pytest -rP-n auto.
3837

3938
publish:
4039
needs:[compile, test]
@@ -46,7 +45,7 @@ jobs:
4645
-name:Set up python
4746
uses:actions/setup-python@v4
4847
with:
49-
python-version:3.8
48+
python-version:3.9
5049
-name:Bootstrap poetry
5150
run:|
5251
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1

‎README.md‎

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@
33
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fintercom%2Fpython-intercom)
44
[![pypi](https://img.shields.io/pypi/v/python-intercom)](https://pypi.python.org/pypi/python-intercom)
55

6-
The Intercom Python library provides convenient access to the Intercom API from Python.
6+
The Intercom Python library provides convenient access to the Intercom APIs from Python.
7+
8+
##Table of Contents
9+
10+
-[Installation](#installation)
11+
-[Reference](#reference)
12+
-[Usage](#usage)
13+
-[Async Client](#async-client)
14+
-[Exception Handling](#exception-handling)
15+
-[Pagination](#pagination)
16+
-[Advanced](#advanced)
17+
-[Access Raw Response Data](#access-raw-response-data)
18+
-[Retries](#retries)
19+
-[Timeouts](#timeouts)
20+
-[Custom Client](#custom-client)
21+
-[Contributing](#contributing)
722

823
##Installation
924

@@ -25,18 +40,14 @@ from intercom import Intercom
2540
client= Intercom(
2641
token="YOUR_TOKEN",
2742
)
28-
client.articles.create(
29-
title="Thanks for everything",
30-
description="Description of the Article",
31-
body="Body of the Article",
32-
author_id=1295,
33-
state="published",
43+
client.ai_content.create_content_import_source(
44+
url="https://www.example.com",
3445
)
3546
```
3647

3748
##Async Client
3849

39-
The SDK also exports an`async` client so that you can make non-blocking calls to our API.
50+
The SDK also exports an`async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use`httpx.AsyncClient()` instead of`httpx.Client()` (e.g. for the`httpx_client` parameter of this client).
4051

4152
```python
4253
import asyncio
@@ -49,12 +60,8 @@ client = AsyncIntercom(
4960

5061

5162
asyncdefmain() ->None:
52-
await client.articles.create(
53-
title="Thanks for everything",
54-
description="Description of the Article",
55-
body="Body of the Article",
56-
author_id=1295,
57-
state="published",
63+
await client.ai_content.create_content_import_source(
64+
url="https://www.example.com",
5865
)
5966

6067

@@ -70,7 +77,7 @@ will be thrown.
7077
from intercom.core.api_errorimport ApiError
7178

7279
try:
73-
client.articles.create(...)
80+
client.ai_content.create_content_import_source(...)
7481
except ApiErroras e:
7582
print(e.status_code)
7683
print(e.body)
@@ -94,6 +101,15 @@ for page in response.iter_pages():
94101
yield page
95102
```
96103

104+
```python
105+
# You can also iterate through pages and access the typed response per page
106+
pager= client.articles.list(...)
107+
for pagein pager.iter_pages():
108+
print(page.response)# access the typed response for each page
109+
for itemin page:
110+
print(item)
111+
```
112+
97113
##Advanced
98114

99115
###Access Raw Response Data
@@ -107,15 +123,15 @@ from intercom import Intercom
107123
client= Intercom(
108124
...,
109125
)
110-
response= client.articles.with_raw_response.create(...)
126+
response= client.ai_content.with_raw_response.create_content_import_source(...)
111127
print(response.headers)# access the response headers
112128
print(response.data)# access the underlying object
113129
pager= client.articles.list(...)
114-
print(pager.response.headers)# access theresponse headers for the first page
130+
print(pager.response)# access thetyped response for the first page
115131
for itemin pager:
116132
print(item)# access the underlying object(s)
117133
for pagein pager.iter_pages():
118-
print(page.response.headers)# access theresponse headers for each page
134+
print(page.response)# access thetyped response for each page
119135
for itemin page:
120136
print(item)# access the underlying object(s)
121137
```
@@ -135,7 +151,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
135151
Use the`max_retries` request option to configure this behavior.
136152

137153
```python
138-
client.articles.create(...,request_options={
154+
client.ai_content.create_content_import_source(...,request_options={
139155
"max_retries":1
140156
})
141157
```
@@ -155,7 +171,7 @@ client = Intercom(
155171

156172

157173
# Override timeout for a specific method
158-
client.articles.create(...,request_options={
174+
client.ai_content.create_content_import_source(...,request_options={
159175
"timeout_in_seconds":1
160176
})
161177
```
@@ -172,7 +188,7 @@ from intercom import Intercom
172188
client= Intercom(
173189
...,
174190
httpx_client=httpx.Client(
175-
proxies="http://my.test.proxy.example.com",
191+
proxy="http://my.test.proxy.example.com",
176192
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
177193
),
178194
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp