Skip to content

Commit a4257c4

Browse files
authored
Merge pull request #478 from hookdeck/fix/python-speakeasy-pagination
Fix: python speakeasy pagination
2 parents 8bd23bb + 11297b5 commit a4257c4

Some content is hidden

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

54 files changed

+1125
-72
lines changed

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
speakeasyVersion: 1.608.0
1+
speakeasyVersion: 1.609.0
22
sources:
33
Outpost API:
44
sourceNamespace: outpost-api
5-
sourceRevisionDigest: sha256:4042dbef541e06289b580460ccfb39d8f444c852e134de2245b13e1ffd43dcf3
6-
sourceBlobDigest: sha256:3859f29c380e176f9382eb969cefbb9c8701875d4837ee8a9549b78bf92eebc6
5+
sourceRevisionDigest: sha256:e09cf02de047cf6d007545274c477e2a90c561074b9de170d844d9ab9ffbbca6
6+
sourceBlobDigest: sha256:c405cfc4f2de092323a9dd68a09f7c08b563d363bce7463fc8b426d10acacf99
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1756910957
109
- 0.0.1
1110
targets:
1211
outpost-go:
@@ -19,10 +18,10 @@ targets:
1918
outpost-python:
2019
source: Outpost API
2120
sourceNamespace: outpost-api
22-
sourceRevisionDigest: sha256:837897b6e2774d7ba547d9616639367bfce651d53d84190c3ee0cd32cee7e8b1
23-
sourceBlobDigest: sha256:3b1cd63370e0cf368a2049eaa26c9f94cd94a929de42592f8488adb5a6a3f182
21+
sourceRevisionDigest: sha256:e09cf02de047cf6d007545274c477e2a90c561074b9de170d844d9ab9ffbbca6
22+
sourceBlobDigest: sha256:c405cfc4f2de092323a9dd68a09f7c08b563d363bce7463fc8b426d10acacf99
2423
codeSamplesNamespace: outpost-api-python-code-samples
25-
codeSamplesRevisionDigest: sha256:c28bb1c6bd595fb3b1353dc6cdc672fa0f11c518f0bf85dcc12c5c02ad35fcc3
24+
codeSamplesRevisionDigest: sha256:d8540bce24dc0cc34650c9546892f1d45db9fe1867c18571e046e9c72123a246
2625
outpost-ts:
2726
source: Outpost API
2827
sourceNamespace: outpost-api
@@ -40,6 +39,7 @@ workflow:
4039
overlays:
4140
- location: ./sdks/schemas/speakeasy-modifications-overlay.yaml
4241
- location: ./sdks/schemas/error-types.yaml
42+
- location: ./sdks/schemas/pagination-fixes-overlay.yaml
4343
registry:
4444
location: registry.speakeasyapi.dev/hookdeck-dev/outpost/outpost-api
4545
targets:

.speakeasy/workflow.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sources:
77
overlays:
88
- location: ./sdks/schemas/speakeasy-modifications-overlay.yaml
99
- location: ./sdks/schemas/error-types.yaml
10+
- location: ./sdks/schemas/pagination-fixes-overlay.yaml
1011
registry:
1112
location: registry.speakeasyapi.dev/hookdeck-dev/outpost/outpost-api
1213
targets:

sdks/outpost-python/.speakeasy/gen.lock

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: da774284-22d9-4b6c-bb26-1c3fc9f2c7ee
33
management:
4-
docChecksum: 3d3f028a2fdd56804d9ae8a2d95a414b
4+
docChecksum: f88900fa0dfdee97044181ff0fbb5027
55
docVersion: 0.0.1
6-
speakeasyVersion: 1.594.0
7-
generationVersion: 2.670.1
8-
releaseVersion: 0.3.0
9-
configChecksum: 3b13091ed8addea8fde7b0db3bd41f0b
6+
speakeasyVersion: 1.609.0
7+
generationVersion: 2.692.0
8+
releaseVersion: 0.4.0
9+
configChecksum: 5010174e527b0e15ea785476055a0d53
1010
repoURL: https://github.com/hookdeck/outpost.git
1111
repoSubDirectory: sdks/outpost-python
1212
installationURL: https://github.com/hookdeck/outpost.git#subdirectory=sdks/outpost-python
@@ -15,7 +15,8 @@ features:
1515
python:
1616
additionalDependencies: 1.0.0
1717
additionalProperties: 1.0.1
18-
core: 5.19.5
18+
constsAndDefaults: 1.0.5
19+
core: 5.20.3
1920
defaultEnabledRetries: 0.2.0
2021
enumUnions: 0.1.0
2122
envVarSecurityUsage: 0.3.2
@@ -28,6 +29,7 @@ features:
2829
methodArguments: 1.0.2
2930
nameOverrides: 3.0.1
3031
nullables: 1.0.1
32+
pagination: 3.0.5
3133
responseFormat: 1.0.1
3234
retries: 3.0.2
3335
sdkHooks: 1.1.0
@@ -44,6 +46,8 @@ generatedFiles:
4446
- docs/errors/unauthorizederror.md
4547
- docs/models/awskinesisconfig.md
4648
- docs/models/awskinesiscredentials.md
49+
- docs/models/awss3config.md
50+
- docs/models/awss3credentials.md
4751
- docs/models/awssqsconfig.md
4852
- docs/models/awssqscredentials.md
4953
- docs/models/azureservicebusconfig.md
@@ -58,13 +62,17 @@ generatedFiles:
5862
- docs/models/destination.md
5963
- docs/models/destinationawskinesis.md
6064
- docs/models/destinationawskinesistype.md
65+
- docs/models/destinationawss3.md
66+
- docs/models/destinationawss3type.md
6167
- docs/models/destinationawssqs.md
6268
- docs/models/destinationawssqstype.md
6369
- docs/models/destinationazureservicebus.md
6470
- docs/models/destinationazureservicebustype.md
6571
- docs/models/destinationcreate.md
6672
- docs/models/destinationcreateawskinesis.md
6773
- docs/models/destinationcreateawskinesistype.md
74+
- docs/models/destinationcreateawss3.md
75+
- docs/models/destinationcreateawss3type.md
6876
- docs/models/destinationcreateawssqs.md
6977
- docs/models/destinationcreateawssqstype.md
7078
- docs/models/destinationcreateazureservicebus.md
@@ -85,6 +93,7 @@ generatedFiles:
8593
- docs/models/destinationtypeschema.md
8694
- docs/models/destinationupdate.md
8795
- docs/models/destinationupdateawskinesis.md
96+
- docs/models/destinationupdateawss3.md
8897
- docs/models/destinationupdateawssqs.md
8998
- docs/models/destinationupdatehookdeck.md
9099
- docs/models/destinationupdaterabbitmq.md
@@ -126,9 +135,13 @@ generatedFiles:
126135
- docs/models/listtenanteventdeliveriesrequest.md
127136
- docs/models/listtenanteventsbydestinationglobals.md
128137
- docs/models/listtenanteventsbydestinationrequest.md
138+
- docs/models/listtenanteventsbydestinationresponse.md
139+
- docs/models/listtenanteventsbydestinationresponsebody.md
129140
- docs/models/listtenanteventsbydestinationstatus.md
130141
- docs/models/listtenanteventsglobals.md
131142
- docs/models/listtenanteventsrequest.md
143+
- docs/models/listtenanteventsresponse.md
144+
- docs/models/listtenanteventsresponsebody.md
132145
- docs/models/listtenanteventsstatus.md
133146
- docs/models/listtenanttopicsglobals.md
134147
- docs/models/listtenanttopicsrequest.md
@@ -196,6 +209,8 @@ generatedFiles:
196209
- src/outpost_sdk/models/__init__.py
197210
- src/outpost_sdk/models/awskinesisconfig.py
198211
- src/outpost_sdk/models/awskinesiscredentials.py
212+
- src/outpost_sdk/models/awss3config.py
213+
- src/outpost_sdk/models/awss3credentials.py
199214
- src/outpost_sdk/models/awssqsconfig.py
200215
- src/outpost_sdk/models/awssqscredentials.py
201216
- src/outpost_sdk/models/azureservicebusconfig.py
@@ -206,10 +221,12 @@ generatedFiles:
206221
- src/outpost_sdk/models/deliveryattempt.py
207222
- src/outpost_sdk/models/destination.py
208223
- src/outpost_sdk/models/destinationawskinesis.py
224+
- src/outpost_sdk/models/destinationawss3.py
209225
- src/outpost_sdk/models/destinationawssqs.py
210226
- src/outpost_sdk/models/destinationazureservicebus.py
211227
- src/outpost_sdk/models/destinationcreate.py
212228
- src/outpost_sdk/models/destinationcreateawskinesis.py
229+
- src/outpost_sdk/models/destinationcreateawss3.py
213230
- src/outpost_sdk/models/destinationcreateawssqs.py
214231
- src/outpost_sdk/models/destinationcreateazureservicebus.py
215232
- src/outpost_sdk/models/destinationcreatehookdeck.py
@@ -221,6 +238,7 @@ generatedFiles:
221238
- src/outpost_sdk/models/destinationtypeschema.py
222239
- src/outpost_sdk/models/destinationupdate.py
223240
- src/outpost_sdk/models/destinationupdateawskinesis.py
241+
- src/outpost_sdk/models/destinationupdateawss3.py
224242
- src/outpost_sdk/models/destinationupdateawssqs.py
225243
- src/outpost_sdk/models/destinationupdatehookdeck.py
226244
- src/outpost_sdk/models/destinationupdaterabbitmq.py
@@ -363,7 +381,7 @@ examples:
363381
query: {}
364382
responses:
365383
"200":
366-
application/json: [{"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}}, {"id": "des_sqs_456", "type": "aws_sqs", "topics": ["*"], "disabled_at": "2024-03-01T12:00:00Z", "created_at": "2024-02-20T11:30:00Z", "config": {"endpoint": "https://sqs.us-west-2.amazonaws.com", "queue_url": "https://sqs.us-west-2.amazonaws.com/123456789012/my-app-queue"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}]
384+
application/json: [{"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}}, {"id": "des_sqs_456", "type": "aws_sqs", "topics": ["*"], "disabled_at": "2024-03-01T12:00:00Z", "created_at": "2024-02-20T11:30:00Z", "config": {"endpoint": "https://sqs.us-west-2.amazonaws.com", "queue_url": "https://sqs.us-west-2.amazonaws.com/123456789012/my-app-queue"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}, {"id": "des_s3_789", "type": "aws_s3", "topics": ["*"], "disabled_at": null, "created_at": "2024-03-20T12:00:00Z", "config": {"bucket": "my-bucket", "region": "us-east-1"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}]
367385
createTenantDestination:
368386
WebhookCreatedExample:
369387
parameters:
@@ -455,7 +473,7 @@ examples:
455473
tenant_id: "<id>"
456474
responses:
457475
"200":
458-
application/json: [{"type": "webhook", "label": "Webhook", "description": "Send event via an HTTP POST request to a URL", "icon": "<svg />", "instructions": "Enter the URL...", "config_fields": [{"type": "text", "label": "URL", "description": "The URL to send the webhook to.", "required": true, "pattern": "^https?://.*"}], "credential_fields": [{"type": "text", "label": "Secret", "description": "Optional signing secret.", "required": false, "sensitive": true}]}, {"type": "aws_sqs", "label": "AWS SQS", "description": "Send event to an AWS SQS queue", "icon": "<svg />", "instructions": "Enter Queue URL...", "config_fields": [{"type": "text", "label": "Queue URL", "description": "The URL of the SQS queue.", "required": true}, {"type": "text", "label": "Endpoint", "description": "Optional custom AWS endpoint URL.", "required": false}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}, {"type": "text", "label": "Session", "description": "Optional AWS Session Token.", "required": false, "sensitive": true}]}]
476+
application/json: [{"type": "webhook", "label": "Webhook", "description": "Send event via an HTTP POST request to a URL", "icon": "<svg />", "instructions": "Enter the URL...", "config_fields": [{"type": "text", "label": "URL", "description": "The URL to send the webhook to.", "required": true, "pattern": "^https?://.*"}], "credential_fields": [{"type": "text", "label": "Secret", "description": "Optional signing secret.", "required": false, "sensitive": true}]}, {"type": "aws_sqs", "label": "AWS SQS", "description": "Send event to an AWS SQS queue", "icon": "<svg />", "instructions": "Enter Queue URL...", "config_fields": [{"type": "text", "label": "Queue URL", "description": "The URL of the SQS queue.", "required": true}, {"type": "text", "label": "Endpoint", "description": "Optional custom AWS endpoint URL.", "required": false}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}, {"type": "text", "label": "Session", "description": "Optional AWS Session Token.", "required": false, "sensitive": true}]}, {"type": "aws_s3", "label": "AWS S3", "description": "Store events in an Amazon S3 bucket", "icon": "<svg />", "instructions": "Enter bucket and region...", "config_fields": [{"type": "text", "label": "Bucket Name", "description": "The name of the S3 bucket.", "required": true}, {"type": "text", "label": "AWS Region", "description": "The AWS region where the bucket is located.", "required": true}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}]}, {"type": "aws_s3", "label": "AWS S3", "description": "Store events in an Amazon S3 bucket", "icon": "<svg />", "instructions": "Enter bucket and region...", "config_fields": [{"type": "text", "label": "Bucket Name", "description": "The name of the S3 bucket.", "required": true}, {"type": "text", "label": "AWS Region", "description": "The AWS region where the bucket is located.", "required": true}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}]}]
459477
getTenantDestinationTypeSchema:
460478
WebhookSchemaExample:
461479
parameters:
@@ -496,10 +514,11 @@ examples:
496514
parameters:
497515
path:
498516
tenant_id: "<id>"
499-
query: {}
517+
query:
518+
limit: 100
500519
responses:
501520
"200":
502-
application/json: [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}]
521+
application/json: {"count": 2, "data": [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}], "next": "", "prev": ""}
503522
getTenantEvent:
504523
EventExample:
505524
parameters:
@@ -524,10 +543,11 @@ examples:
524543
path:
525544
tenant_id: "<id>"
526545
destination_id: "<id>"
527-
query: {}
546+
query:
547+
limit: 100
528548
responses:
529549
"200":
530-
application/json: [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}]
550+
application/json: {"count": 2, "data": [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}], "next": "", "prev": ""}
531551
getTenantEventByDestination:
532552
EventExample:
533553
parameters:

sdks/outpost-python/.speakeasy/gen.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ generation:
2121
generateNewTests: false
2222
skipResponseBodyAssertions: false
2323
python:
24-
version: 0.3.0
24+
version: 0.4.0
2525
additionalDependencies:
2626
dev: {}
2727
main: {}
28+
allowedRedefinedBuiltins:
29+
- id
30+
- object
2831
authors:
2932
- Speakeasy
3033
baseErrorName: OutpostError
@@ -51,6 +54,7 @@ python:
5154
methodArguments: infer-optional-args
5255
moduleName: ""
5356
outputModelSuffix: output
57+
packageManager: poetry
5458
packageName: outpost_sdk
5559
pytestFilterWarnings: []
5660
pytestTimeout: 0

sdks/outpost-python/README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Outpost API: The Outpost API is a REST-based JSON API for managing tenants, dest
2525
* [Authentication](#authentication)
2626
* [Available Resources and Operations](#available-resources-and-operations)
2727
* [Global Parameters](#global-parameters)
28+
* [Pagination](#pagination)
2829
* [Retries](#retries)
2930
* [Error Handling](#error-handling)
3031
* [Server Selection](#server-selection)
@@ -45,7 +46,15 @@ Outpost API: The Outpost API is a REST-based JSON API for managing tenants, dest
4546
>
4647
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
4748
48-
The SDK can be installed with either *pip* or *poetry* package managers.
49+
The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
50+
51+
### uv
52+
53+
*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
54+
55+
```bash
56+
uv add outpost_sdk
57+
```
4958

5059
### PIP
5160

@@ -125,7 +134,7 @@ with Outpost() as outpost:
125134

126135
</br>
127136

128-
The same SDK client can also be used to make asychronous requests by importing asyncio.
137+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
129138
```python
130139
# Asynchronous Example
131140
import asyncio
@@ -269,6 +278,35 @@ with Outpost(
269278
```
270279
<!-- End Global Parameters [global-parameters] -->
271280

281+
<!-- Start Pagination [pagination] -->
282+
## Pagination
283+
284+
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
285+
returned response object will have a `Next` method that can be called to pull down the next group of results. If the
286+
return value of `Next` is `None`, then there are no more pages to be fetched.
287+
288+
Here's an example of one such pagination call:
289+
```python
290+
from outpost_sdk import Outpost, models
291+
292+
293+
with Outpost(
294+
tenant_id="<id>",
295+
security=models.Security(
296+
admin_api_key="<YOUR_BEARER_TOKEN_HERE>",
297+
),
298+
) as outpost:
299+
300+
res = outpost.events.list(limit=100)
301+
302+
while res is not None:
303+
# Handle items
304+
305+
res = res.next()
306+
307+
```
308+
<!-- End Pagination [pagination] -->
309+
272310
<!-- Start Retries [retries] -->
273311
## Retries
274312

sdks/outpost-python/USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ with Outpost() as outpost:
1414

1515
</br>
1616

17-
The same SDK client can also be used to make asychronous requests by importing asyncio.
17+
The same SDK client can also be used to make asynchronous requests by importing asyncio.
1818
```python
1919
# Asynchronous Example
2020
import asyncio

0 commit comments

Comments
 (0)