Skip to content

Commit

Permalink
Merge pull request #89 from dubinc/speakeasy-sdk-regen-1738369678
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate 0.17.8
  • Loading branch information
devkiran authored Feb 3, 2025
2 parents f2d5f4f + b1804d3 commit aea8de3
Show file tree
Hide file tree
Showing 64 changed files with 2,202 additions and 1,507 deletions.
36 changes: 18 additions & 18 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
python:
version: 0.17.7
version: 0.17.8
additionalDependencies:
dev: {}
main: {}
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.477.0
speakeasyVersion: 1.481.1
sources:
dub:
sourceNamespace: dub
sourceRevisionDigest: sha256:abb0f937d166f84f7f8392658c07cfa2c9eece26ed3e460901f3556e56a4c1f1
sourceBlobDigest: sha256:da929e7a20181506118615afd944c021763386d368b40cdf11a18967665213b0
sourceRevisionDigest: sha256:f45a09958121f0599f23910009268645adc04b050891c145b8ffc772d32210d7
sourceBlobDigest: sha256:c2b6e2ed11dd5fe51a0412df7d8a815d3d3d281d73ab77d4e53425c6f2ca3f24
tags:
- latest
- speakeasy-sdk-regen-1738110339
- speakeasy-sdk-regen-1738369678
- 0.0.1
targets:
my-first-target:
source: dub
sourceNamespace: dub
sourceRevisionDigest: sha256:abb0f937d166f84f7f8392658c07cfa2c9eece26ed3e460901f3556e56a4c1f1
sourceBlobDigest: sha256:da929e7a20181506118615afd944c021763386d368b40cdf11a18967665213b0
sourceRevisionDigest: sha256:f45a09958121f0599f23910009268645adc04b050891c145b8ffc772d32210d7
sourceBlobDigest: sha256:c2b6e2ed11dd5fe51a0412df7d8a815d3d3d281d73ab77d4e53425c6f2ca3f24
codeSamplesNamespace: code-samples-python-my-first-target
codeSamplesRevisionDigest: sha256:4200b14caddf17a565686a298852f6901d66ba5113a3b1b2167ada20151b1480
codeSamplesRevisionDigest: sha256:83a6c9d90a663c786aa97079234fe46062871201297068f6ac03c27a8ff64b5b
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,37 @@ pip install dub
```bash
poetry add dub
```

### Shell and script usage with `uv`

You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:

```shell
uvx --from dub python
```

It's also possible to write a standalone Python script without needing to set up a whole project like so:

```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "dub",
# ]
# ///

from dub import Dub

sdk = Dub(
# SDK arguments
)

# Rest of script here...
```

Once that is saved to a file, you can run it with `uv run script.py` where
`script.py` can be replaced with the actual file name.
<!-- End SDK Installation [installation] -->

<!-- Start SDK Example Usage [usage] -->
Expand Down Expand Up @@ -552,20 +583,12 @@ return value of `Next` is `None`, then there are no more pages to be fetched.
Here's an example of one such pagination call:
```python
from dub import Dub
from dub.models import operations

with Dub(
token="DUB_API_KEY",
) as d_client:

res = d_client.links.list(request={
"show_archived": True,
"with_tags": True,
"sort_by": operations.SortBy.CREATED_AT,
"sort_order": operations.SortOrder.DESC,
"page": 1,
"page_size": 50,
})
res = d_client.links.list(request={})

while res is not None:
# Handle items
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -796,4 +796,14 @@ Based on:
### Generated
- [python v0.17.7] .
### Releases
- [PyPI v0.17.7] https://pypi.org/project/dub/0.17.7 - .
- [PyPI v0.17.7] https://pypi.org/project/dub/0.17.7 - .

## 2025-02-03 00:26:21
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.481.1 (2.500.5) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.17.8] .
### Releases
- [PyPI v0.17.8] https://pypi.org/project/dub/0.17.8 - .
61 changes: 4 additions & 57 deletions codeSamples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ actions:
label: retrieveAnalytics
source: |-
from dub import Dub
from dub.models import operations
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.analytics.retrieve(request={
"event": operations.Event.CLICKS,
"group_by": operations.QueryParamGroupBy.COUNT,
"timezone": "America/New_York",
"city": "New York",
"device": "Desktop",
"browser": "Chrome",
Expand Down Expand Up @@ -120,11 +116,7 @@ actions:
token="DUB_API_KEY",
) as d_client:
res = d_client.domains.list(request={
"archived": True,
"page": 1,
"page_size": 50,
})
res = d_client.domains.list(request={})
while res is not None:
# Handle items
Expand All @@ -146,7 +138,6 @@ actions:
"slug": "acme.com",
"expired_url": "https://acme.com/expired",
"not_found_url": "https://acme.com/not-found",
"archived": False,
"placeholder": "https://dub.co/help/article/what-is-dub",
})
Expand Down Expand Up @@ -188,7 +179,6 @@ actions:
"slug": "acme.com",
"expired_url": "https://acme.com/expired",
"not_found_url": "https://acme.com/not-found",
"archived": False,
"placeholder": "https://dub.co/help/article/what-is-dub",
})
Expand All @@ -203,26 +193,18 @@ actions:
label: listEvents
source: |-
from dub import Dub
from dub.models import operations
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.events.list(request={
"event": operations.QueryParamEvent.CLICKS,
"interval": operations.QueryParamInterval.TWENTY_FOURH,
"timezone": "America/New_York",
"city": "New York",
"device": "Desktop",
"browser": "Chrome",
"os": "Windows",
"referer": "google.com",
"referer_url": "https://dub.co/blog",
"page": 1,
"limit": 100,
"sort_order": operations.QueryParamSortOrder.DESC,
"sort_by": operations.QueryParamSortBy.TIMESTAMP,
})
assert res is not None
Expand All @@ -236,20 +218,12 @@ actions:
label: getLinks
source: |-
from dub import Dub
from dub.models import operations
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.links.list(request={
"show_archived": True,
"with_tags": True,
"sort_by": operations.SortBy.CREATED_AT,
"sort_order": operations.SortOrder.DESC,
"page": 1,
"page_size": 50,
})
res = d_client.links.list(request={})
while res is not None:
# Handle items
Expand Down Expand Up @@ -372,10 +346,7 @@ actions:
token="DUB_API_KEY",
) as d_client:
res = d_client.links.count(request={
"show_archived": True,
"with_tags": True,
})
res = d_client.links.count(request={})
assert res is not None
Expand Down Expand Up @@ -524,21 +495,13 @@ actions:
label: getQRCode
source: |-
from dub import Dub
from dub.models import operations
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.qr_codes.get(request={
"url": "https://normal-making.name",
"size": 600,
"level": operations.Level.L,
"fg_color": "#000000",
"bg_color": "#FFFFFF",
"hide_logo": True,
"margin": 2,
"include_margin": True,
})
assert res is not None
Expand All @@ -552,18 +515,12 @@ actions:
label: getTags
source: |-
from dub import Dub
from dub.models import operations
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.tags.list(request={
"sort_by": operations.GetTagsQueryParamSortBy.NAME,
"sort_order": operations.GetTagsQueryParamSortOrder.ASC,
"page": 1,
"page_size": 50,
})
res = d_client.tags.list(request={})
assert res is not None
Expand Down Expand Up @@ -656,11 +613,6 @@ actions:
res = d_client.track.lead(request={
"click_id": "<id>",
"event_name": "Sign up",
"external_id": "",
"customer_id": None,
"customer_name": None,
"customer_email": None,
"customer_avatar": None,
})
assert res is not None
Expand All @@ -681,13 +633,8 @@ actions:
) as d_client:
res = d_client.track.sale(request={
"external_id": "",
"customer_id": None,
"amount": 996500,
"payment_processor": operations.PaymentProcessor.PADDLE,
"event_name": "Purchase",
"invoice_id": None,
"currency": "usd",
})
assert res is not None
Expand Down
Loading

0 comments on commit aea8de3

Please sign in to comment.