Skip to content

Commit

Permalink
Refactor: Regenerate with new name (airbyte_api) and consolidated m…
Browse files Browse the repository at this point in the history
…odule hierarchy (#72)
  • Loading branch information
aaronsteers authored Apr 11, 2024
1 parent a439ef8 commit d80a8db
Show file tree
Hide file tree
Showing 2,870 changed files with 71,640 additions and 15,985 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ src/*.egg-info/
__pycache__/
.pytest_cache/
.python-version`
.env
4,478 changes: 2,248 additions & 2,230 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
workflowVersion: 1.0.0
sources:
my-source:
inputs:
- location: ./airbyte-api.openapi.yaml
targets:
python-api:
target: python
source: my-source
publish:
pypi:
token: $PYPI_TOKEN
71 changes: 38 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ pip install airbyte-api
### Example

```python
import airbyte
from airbyte.models import shared
import airbyte_api
from airbyte_api import models

s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
s = airbyte_api.AirbyteAPI(
security=models.Security(
basic_auth=models.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)

req = shared.ConnectionCreateRequest(
req = models.ConnectionCreateRequest(
destination_id='c669dd1e-3620-483e-afc8-55914e0a570f',
source_id='6dd427d8-3a55-4584-b835-842325b6c7b3',
namespace_format='${SOURCE_NAMESPACE}',
Expand All @@ -50,6 +50,7 @@ res = s.connections.create_connection(req)
if res.connection_response is not None:
# handle response
pass

```
<!-- End SDK Example Usage [usage] -->

Expand Down Expand Up @@ -117,24 +118,24 @@ Handling errors in this SDK should largely match your expectations. All operati

| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4x-5xx | */* |
| errors.SDKError | 4xx-5xx | */* |

### Example

```python
import airbyte
from airbyte.models import errors, shared
import airbyte_api
from airbyte_api import errors, models

s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
s = airbyte_api.AirbyteAPI(
security=models.Security(
basic_auth=models.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)

req = shared.ConnectionCreateRequest(
req = models.ConnectionCreateRequest(
destination_id='c669dd1e-3620-483e-afc8-55914e0a570f',
source_id='6dd427d8-3a55-4584-b835-842325b6c7b3',
namespace_format='${SOURCE_NAMESPACE}',
Expand All @@ -150,6 +151,7 @@ except errors.SDKError as e:
if res.connection_response is not None:
# handle response
pass

```
<!-- End Error Handling [errors] -->

Expand All @@ -169,20 +171,20 @@ You can override the default server globally by passing a server index to the `s
#### Example

```python
import airbyte
from airbyte.models import shared
import airbyte_api
from airbyte_api import models

s = airbyte.Airbyte(
s = airbyte_api.AirbyteAPI(
server_idx=0,
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
security=models.Security(
basic_auth=models.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)

req = shared.ConnectionCreateRequest(
req = models.ConnectionCreateRequest(
destination_id='c669dd1e-3620-483e-afc8-55914e0a570f',
source_id='6dd427d8-3a55-4584-b835-842325b6c7b3',
namespace_format='${SOURCE_NAMESPACE}',
Expand All @@ -193,27 +195,28 @@ res = s.connections.create_connection(req)
if res.connection_response is not None:
# handle response
pass

```


### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
```python
import airbyte
from airbyte.models import shared
import airbyte_api
from airbyte_api import models

s = airbyte.Airbyte(
s = airbyte_api.AirbyteAPI(
server_url="https://api.airbyte.com/v1",
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
security=models.Security(
basic_auth=models.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)

req = shared.ConnectionCreateRequest(
req = models.ConnectionCreateRequest(
destination_id='c669dd1e-3620-483e-afc8-55914e0a570f',
source_id='6dd427d8-3a55-4584-b835-842325b6c7b3',
namespace_format='${SOURCE_NAMESPACE}',
Expand All @@ -224,6 +227,7 @@ res = s.connections.create_connection(req)
if res.connection_response is not None:
# handle response
pass

```
<!-- End Server Selection [server] -->

Expand All @@ -236,12 +240,12 @@ The Python SDK makes API calls using the [requests](https://pypi.org/project/req

For example, you could specify a header for every request that this sdk makes as follows:
```python
import airbyte
import airbyte_api
import requests

http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = airbyte.Airbyte(client: http_client)
s = airbyte_api.AirbyteAPI(client=http_client)
```
<!-- End Custom HTTP Client [http-client] -->

Expand All @@ -261,19 +265,19 @@ This SDK supports the following security schemes globally:

You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
```python
import airbyte
from airbyte.models import shared
import airbyte_api
from airbyte_api import models

s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
s = airbyte_api.AirbyteAPI(
security=models.Security(
basic_auth=models.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)

req = shared.ConnectionCreateRequest(
req = models.ConnectionCreateRequest(
destination_id='c669dd1e-3620-483e-afc8-55914e0a570f',
source_id='6dd427d8-3a55-4584-b835-842325b6c7b3',
namespace_format='${SOURCE_NAMESPACE}',
Expand All @@ -284,6 +288,7 @@ res = s.connections.create_connection(req)
if res.connection_response is not None:
# handle response
pass

```
<!-- End Authentication [security] -->

Expand Down
13 changes: 7 additions & 6 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<!-- Start SDK Example Usage [usage] -->
```python
import airbyte
from airbyte.models import shared
import airbyte_api
from airbyte_api import models

s = airbyte.Airbyte(
security=shared.Security(
basic_auth=shared.SchemeBasicAuth(
s = airbyte_api.AirbyteAPI(
security=models.Security(
basic_auth=models.SchemeBasicAuth(
password="<YOUR_PASSWORD_HERE>",
username="<YOUR_USERNAME_HERE>",
),
),
)

req = shared.ConnectionCreateRequest(
req = models.ConnectionCreateRequest(
destination_id='c669dd1e-3620-483e-afc8-55914e0a570f',
source_id='6dd427d8-3a55-4584-b835-842325b6c7b3',
namespace_format='${SOURCE_NAMESPACE}',
Expand All @@ -23,5 +23,6 @@ res = s.connections.create_connection(req)
if res.connection_response is not None:
# handle response
pass

```
<!-- End SDK Example Usage [usage] -->
Loading

0 comments on commit d80a8db

Please sign in to comment.