Skip to content

Commit 1802937

Browse files
committed
feat(api): update via SDK Studio
1 parent c5ee578 commit 1802937

File tree

309 files changed

+2151
-1460
lines changed

Some content is hidden

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

309 files changed

+2151
-1460
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: CI
22
on:
33
push:
44
branches:
5-
- main
5+
- v3
66
pull_request:
77
branches:
8-
- main
8+
- v3
99

1010
jobs:
1111
lint:

.github/workflows/create-releases.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
- cron: '0 5 * * *' # every day at 5am UTC
55
push:
66
branches:
7-
- main
7+
- v3
88

99
jobs:
1010
release:
1111
name: release
12-
if: github.ref == 'refs/heads/main' && github.repository == 'intercom/intercom-python'
12+
if: github.ref == 'refs/heads/v3' && github.repository == 'intercom/python-intercom'
1313
runs-on: ubuntu-latest
1414

1515
steps:

.github/workflows/handle-release-pr-title-edit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
github.event.pull_request.state == 'open' &&
1616
github.event.sender.login != 'stainless-bot' &&
1717
github.event.sender.login != 'stainless-app' &&
18-
github.repository == 'intercom/intercom-python'
18+
github.repository == 'intercom/python-intercom'
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# workflow for re-running publishing to PyPI in case it fails for some reason
2-
# you can run this workflow by navigating to https://www.github.com/intercom/intercom-python/actions/workflows/publish-pypi.yml
2+
# you can run this workflow by navigating to https://www.github.com/intercom/python-intercom/actions/workflows/publish-pypi.yml
33
name: Publish PyPI
44
on:
55
workflow_dispatch:

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
release_doctor:
88
name: release doctor
99
runs-on: ubuntu-latest
10-
if: github.repository == 'intercom/intercom-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
10+
if: github.repository == 'intercom/python-intercom' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1111

1212
steps:
1313
- uses: actions/checkout@v4

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 106
1+
configured_endpoints: 107
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/intercom%2Fintercom-a202b2b4aa0e356eb61376a3bf484132be2e9e3bff3796e1fe4606ab2a3734fd.yml

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock
3232
## Modifying/Adding code
3333

3434
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
35-
`src/intercom/lib/` and `examples/` directories are exceptions and will never be overridden.
35+
`src/python_intercom/lib/` and `examples/` directories are exceptions and will never be overridden.
3636

3737
## Adding and running examples
3838

@@ -59,7 +59,7 @@ If you’d like to use the repository from source, you can either install from g
5959
To install via git:
6060

6161
```bash
62-
pip install git+ssh://git@github.com/intercom/intercom-python.git
62+
pip install git+ssh://git@github.com/intercom/python-intercom#v3.git
6363
```
6464

6565
Alternatively, you can build from source and install the wheel file:
@@ -117,7 +117,7 @@ the changes aren't made through the automated pipeline, you may want to make rel
117117

118118
### Publish with a GitHub workflow
119119

120-
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/intercom/intercom-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
120+
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/intercom/python-intercom/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
121121

122122
### Publish manually
123123

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Intercom Python API library
22

3-
[![PyPI version](https://img.shields.io/pypi/v/intercom.svg)](https://pypi.org/project/intercom/)
3+
[![PyPI version](https://img.shields.io/pypi/v/python-intercom.svg)](https://pypi.org/project/python-intercom/)
44

55
The Intercom Python library provides convenient access to the Intercom REST API from any Python 3.7+
66
application. The library includes type definitions for all request params and response fields,
@@ -16,19 +16,19 @@ The REST API documentation can be found [on developers.intercom.com](https://dev
1616

1717
```sh
1818
# install from the production repo
19-
pip install git+ssh://git@github.com/intercom/intercom-python.git
19+
pip install git+ssh://git@github.com/intercom/python-intercom#v3.git
2020
```
2121

2222
> [!NOTE]
23-
> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install intercom`
23+
> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install python-intercom`
2424
2525
## Usage
2626

2727
The full API of this library can be found in [api.md](api.md).
2828

2929
```python
3030
import os
31-
from intercom import Intercom
31+
from python_intercom import Intercom
3232

3333
client = Intercom(
3434
# This is the default and can be omitted
@@ -53,7 +53,7 @@ Simply import `AsyncIntercom` instead of `Intercom` and use `await` with each AP
5353
```python
5454
import os
5555
import asyncio
56-
from intercom import AsyncIntercom
56+
from python_intercom import AsyncIntercom
5757

5858
client = AsyncIntercom(
5959
# This is the default and can be omitted
@@ -84,27 +84,27 @@ Typed requests and responses provide autocomplete and documentation within your
8484

8585
## Handling errors
8686

87-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `intercom.APIConnectionError` is raised.
87+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `python_intercom.APIConnectionError` is raised.
8888

8989
When the API returns a non-success status code (that is, 4xx or 5xx
90-
response), a subclass of `intercom.APIStatusError` is raised, containing `status_code` and `response` properties.
90+
response), a subclass of `python_intercom.APIStatusError` is raised, containing `status_code` and `response` properties.
9191

92-
All errors inherit from `intercom.APIError`.
92+
All errors inherit from `python_intercom.APIError`.
9393

9494
```python
95-
import intercom
96-
from intercom import Intercom
95+
import python_intercom
96+
from python_intercom import Intercom
9797

9898
client = Intercom()
9999

100100
try:
101101
client.me.retrieve()
102-
except intercom.APIConnectionError as e:
102+
except python_intercom.APIConnectionError as e:
103103
print("The server could not be reached")
104104
print(e.__cause__) # an underlying Exception, likely raised within httpx.
105-
except intercom.RateLimitError as e:
105+
except python_intercom.RateLimitError as e:
106106
print("A 429 status code was received; we should back off a bit.")
107-
except intercom.APIStatusError as e:
107+
except python_intercom.APIStatusError as e:
108108
print("Another non-200-range status code was received")
109109
print(e.status_code)
110110
print(e.response)
@@ -132,7 +132,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
132132
You can use the `max_retries` option to configure or disable retry settings:
133133

134134
```python
135-
from intercom import Intercom
135+
from python_intercom import Intercom
136136

137137
# Configure the default for all requests:
138138
client = Intercom(
@@ -150,7 +150,7 @@ By default requests time out after 1 minute. You can configure this with a `time
150150
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
151151

152152
```python
153-
from intercom import Intercom
153+
from python_intercom import Intercom
154154

155155
# Configure the default for all requests:
156156
client = Intercom(
@@ -200,7 +200,7 @@ if response.my_field is None:
200200
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
201201

202202
```py
203-
from intercom import Intercom
203+
from python_intercom import Intercom
204204

205205
client = Intercom()
206206
response = client.me.with_raw_response.retrieve()
@@ -210,9 +210,9 @@ me = response.parse() # get the object that `me.retrieve()` would have returned
210210
print(me.id)
211211
```
212212

213-
These methods return an [`APIResponse`](https://github.com/intercom/intercom-python/tree/main/src/intercom/_response.py) object.
213+
These methods return an [`APIResponse`](https://github.com/intercom/python-intercom/tree/v3/src/python_intercom/_response.py) object.
214214

215-
The async client returns an [`AsyncAPIResponse`](https://github.com/intercom/intercom-python/tree/main/src/intercom/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
215+
The async client returns an [`AsyncAPIResponse`](https://github.com/intercom/python-intercom/tree/v3/src/python_intercom/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
216216

217217
#### `.with_streaming_response`
218218

@@ -274,7 +274,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
274274
- Additional [advanced](https://www.python-httpx.org/advanced/#client-instances) functionality
275275

276276
```python
277-
from intercom import Intercom, DefaultHttpxClient
277+
from python_intercom import Intercom, DefaultHttpxClient
278278

279279
client = Intercom(
280280
# Or use the `INTERCOM_BASE_URL` env var
@@ -300,7 +300,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
300300

301301
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
302302

303-
We are keen for your feedback; please open an [issue](https://www.github.com/intercom/intercom-python/issues) with questions, bugs, or suggestions.
303+
We are keen for your feedback; please open an [issue](https://www.github.com/intercom/python-intercom/issues) with questions, bugs, or suggestions.
304304

305305
## Requirements
306306

0 commit comments

Comments
 (0)