Skip to content

Commit ed82c28

Browse files
committed
Move custom webhooks module now that we have a generated webhooks for the endpoints
1 parent 3da0700 commit ed82c28

54 files changed

Lines changed: 3318 additions & 48 deletions

Some content is hidden

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

.genignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.zed/
22
src/polar_sdk/ingestion/
3-
src/polar_sdk/webhooks/
3+
src/polar_sdk/_webhooks/
44
src/tests/
55
ruff.toml

.speakeasy/gen.lock

Lines changed: 121 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
lockVersion: 2.0.0
22
id: e7042734-e669-4c36-85da-bbb4a7500ac8
33
management:
4-
docChecksum: 21c56dd1f80881176eb591fbc35a6f38
4+
docChecksum: 6628cb0f0d77f375778bc6c286cb8fd1
55
docVersion: 0.1.0
6-
speakeasyVersion: 1.561.0
7-
generationVersion: 2.628.0
6+
speakeasyVersion: 1.563.4
7+
generationVersion: 2.630.6
88
releaseVersion: 0.20.1
99
configChecksum: bd9d90d89fb4b17f8bbc6520f987064f
1010
repoURL: https://github.com/polarsource/polar-python.git
@@ -487,6 +487,7 @@ generatedFiles:
487487
- docs/models/downloadablefilecreate.md
488488
- docs/models/downloadablefileread.md
489489
- docs/models/downloadableread.md
490+
- docs/models/endpointid.md
490491
- docs/models/event.md
491492
- docs/models/eventcreatecustomer.md
492493
- docs/models/eventcreatecustomermetadata.md
@@ -591,6 +592,8 @@ generatedFiles:
591592
- docs/models/listresourcerefund.md
592593
- docs/models/listresourcesubscription.md
593594
- docs/models/listresourceunionpaymentmethodcardpaymentmethodgeneric.md
595+
- docs/models/listresourcewebhookdelivery.md
596+
- docs/models/listresourcewebhookendpoint.md
594597
- docs/models/loc.md
595598
- docs/models/meta.md
596599
- docs/models/metadata.md
@@ -780,6 +783,7 @@ generatedFiles:
780783
- docs/models/queryparamexternalcustomeridfilter.md
781784
- docs/models/queryparammeteridfilter.md
782785
- docs/models/queryparamorderidfilter.md
786+
- docs/models/queryparamorganizationid.md
783787
- docs/models/queryparamorganizationidfilter.md
784788
- docs/models/queryparamproductbillingtypefilter.md
785789
- docs/models/queryparamproductidfilter.md
@@ -873,6 +877,13 @@ generatedFiles:
873877
- docs/models/webhookcustomerdeletedpayload.md
874878
- docs/models/webhookcustomerstatechangedpayload.md
875879
- docs/models/webhookcustomerupdatedpayload.md
880+
- docs/models/webhookdelivery.md
881+
- docs/models/webhookendpoint.md
882+
- docs/models/webhookendpointcreate.md
883+
- docs/models/webhookendpointupdate.md
884+
- docs/models/webhookevent.md
885+
- docs/models/webhookeventtype.md
886+
- docs/models/webhookformat.md
876887
- docs/models/webhookordercreatedpayload.md
877888
- docs/models/webhookorderpaidpayload.md
878889
- docs/models/webhookorderrefundedpayload.md
@@ -882,12 +893,20 @@ generatedFiles:
882893
- docs/models/webhookproductupdatedpayload.md
883894
- docs/models/webhookrefundcreatedpayload.md
884895
- docs/models/webhookrefundupdatedpayload.md
896+
- docs/models/webhooksdeletewebhookendpointrequest.md
897+
- docs/models/webhooksgetwebhookendpointrequest.md
898+
- docs/models/webhookslistwebhookdeliveriesrequest.md
899+
- docs/models/webhookslistwebhookdeliveriesresponse.md
900+
- docs/models/webhookslistwebhookendpointsrequest.md
901+
- docs/models/webhookslistwebhookendpointsresponse.md
902+
- docs/models/webhooksredeliverwebhookeventrequest.md
885903
- docs/models/webhooksubscriptionactivepayload.md
886904
- docs/models/webhooksubscriptioncanceledpayload.md
887905
- docs/models/webhooksubscriptioncreatedpayload.md
888906
- docs/models/webhooksubscriptionrevokedpayload.md
889907
- docs/models/webhooksubscriptionuncanceledpayload.md
890908
- docs/models/webhooksubscriptionupdatedpayload.md
909+
- docs/models/webhooksupdatewebhookendpointrequest.md
891910
- docs/sdks/benefitgrants/README.md
892911
- docs/sdks/benefits/README.md
893912
- docs/sdks/checkoutlinks/README.md
@@ -919,6 +938,7 @@ generatedFiles:
919938
- docs/sdks/products/README.md
920939
- docs/sdks/refunds/README.md
921940
- docs/sdks/subscriptions/README.md
941+
- docs/sdks/webhooks/README.md
922942
- poetry.toml
923943
- py.typed
924944
- pylintrc
@@ -1289,6 +1309,8 @@ generatedFiles:
12891309
- src/polar_sdk/models/listresource_refund_.py
12901310
- src/polar_sdk/models/listresource_subscription_.py
12911311
- src/polar_sdk/models/listresource_union_paymentmethodcard_paymentmethodgeneric_.py
1312+
- src/polar_sdk/models/listresource_webhookdelivery_.py
1313+
- src/polar_sdk/models/listresource_webhookendpoint_.py
12921314
- src/polar_sdk/models/meter.py
12931315
- src/polar_sdk/models/metercreate.py
12941316
- src/polar_sdk/models/metercreditedmetadata.py
@@ -1451,6 +1473,13 @@ generatedFiles:
14511473
- src/polar_sdk/models/webhookcustomerdeletedpayload.py
14521474
- src/polar_sdk/models/webhookcustomerstatechangedpayload.py
14531475
- src/polar_sdk/models/webhookcustomerupdatedpayload.py
1476+
- src/polar_sdk/models/webhookdelivery.py
1477+
- src/polar_sdk/models/webhookendpoint.py
1478+
- src/polar_sdk/models/webhookendpointcreate.py
1479+
- src/polar_sdk/models/webhookendpointupdate.py
1480+
- src/polar_sdk/models/webhookevent.py
1481+
- src/polar_sdk/models/webhookeventtype.py
1482+
- src/polar_sdk/models/webhookformat.py
14541483
- src/polar_sdk/models/webhookordercreatedpayload.py
14551484
- src/polar_sdk/models/webhookorderpaidpayload.py
14561485
- src/polar_sdk/models/webhookorderrefundedpayload.py
@@ -1460,6 +1489,12 @@ generatedFiles:
14601489
- src/polar_sdk/models/webhookproductupdatedpayload.py
14611490
- src/polar_sdk/models/webhookrefundcreatedpayload.py
14621491
- src/polar_sdk/models/webhookrefundupdatedpayload.py
1492+
- src/polar_sdk/models/webhooks_delete_webhook_endpointop.py
1493+
- src/polar_sdk/models/webhooks_get_webhook_endpointop.py
1494+
- src/polar_sdk/models/webhooks_list_webhook_deliveriesop.py
1495+
- src/polar_sdk/models/webhooks_list_webhook_endpointsop.py
1496+
- src/polar_sdk/models/webhooks_redeliver_webhook_eventop.py
1497+
- src/polar_sdk/models/webhooks_update_webhook_endpointop.py
14631498
- src/polar_sdk/models/webhooksubscriptionactivepayload.py
14641499
- src/polar_sdk/models/webhooksubscriptioncanceledpayload.py
14651500
- src/polar_sdk/models/webhooksubscriptioncreatedpayload.py
@@ -1500,6 +1535,7 @@ generatedFiles:
15001535
- src/polar_sdk/utils/serializers.py
15011536
- src/polar_sdk/utils/url.py
15021537
- src/polar_sdk/utils/values.py
1538+
- src/polar_sdk/webhooks.py
15031539
examples:
15041540
_endpointcheckout_created_post:
15051541
speakeasy-default-endpointcheckout-created-post:
@@ -1901,7 +1937,7 @@ examples:
19011937
oauth2:clients:oauth2:create_client:
19021938
speakeasy-default-oauth2-:clients:oauth2-:create-client:
19031939
requestBody:
1904-
application/json: {"redirect_uris": ["https://impolite-hippodrome.com/", "https://acidic-tomography.net/"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write transactions:read transactions:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_meters:read customer_sessions:write orders:read orders:write refunds:read refunds:write payments:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write notifications:read notifications:write notification_recipients:read notification_recipients:write", "client_name": "<value>"}
1940+
application/json: {"redirect_uris": ["https://impolite-hippodrome.com/", "https://acidic-tomography.net/"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write transactions:read transactions:write payouts:read payouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_meters:read customer_sessions:write orders:read orders:write refunds:read refunds:write payments:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write notifications:read notifications:write notification_recipients:read notification_recipients:write", "client_name": "<value>"}
19051941
responses:
19061942
"200":
19071943
application/json: "<value>"
@@ -1923,7 +1959,7 @@ examples:
19231959
path:
19241960
client_id: "<id>"
19251961
requestBody:
1926-
application/json: {"redirect_uris": ["https://classic-cantaloupe.org", "https://corrupt-status.biz/"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write transactions:read transactions:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_meters:read customer_sessions:write orders:read orders:write refunds:read refunds:write payments:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write notifications:read notifications:write notification_recipients:read notification_recipients:write", "client_name": "<value>", "client_id": "<id>"}
1962+
application/json: {"redirect_uris": ["https://classic-cantaloupe.org", "https://corrupt-status.biz/"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write transactions:read transactions:write payouts:read payouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_meters:read customer_sessions:write orders:read orders:write refunds:read refunds:write payments:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write notifications:read notifications:write notification_recipients:read notification_recipients:write", "client_name": "<value>", "client_id": "<id>"}
19271963
responses:
19281964
"200":
19291965
application/json: "<value>"
@@ -3181,5 +3217,85 @@ examples:
31813217
application/json: {"error": "InvoiceAlreadyExists", "detail": "<value>"}
31823218
"422":
31833219
application/json: {"error": "MissingInvoiceBillingDetails", "detail": "<value>"}
3220+
webhooks:list_webhook_endpoints:
3221+
speakeasy-default-webhooks:list-webhook-endpoints:
3222+
parameters:
3223+
query:
3224+
organization_id: "1dbfc517-0bbf-4301-9ba8-555ca42b9737"
3225+
page: 1
3226+
limit: 10
3227+
responses:
3228+
"200":
3229+
application/json: {"items": [{"created_at": "2023-07-05T09:44:10.221Z", "modified_at": null, "id": "<value>", "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0", "format": "discord", "organization_id": "<value>", "events": ["order.created"]}], "pagination": {"total_count": 849585, "max_page": 594288}}
3230+
"422":
3231+
application/json: {}
3232+
webhooks:create_webhook_endpoint:
3233+
speakeasy-default-webhooks:create-webhook-endpoint:
3234+
requestBody:
3235+
application/json: {"url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0", "format": "slack", "secret": "f_z6mfSpxkjogyw3FkA2aH2gYE5huxruNf34MpdWMcA", "events": ["subscription.uncanceled"], "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737"}
3236+
responses:
3237+
"201":
3238+
application/json: {"created_at": "2023-03-20T06:36:18.270Z", "modified_at": "2023-08-13T00:46:23.703Z", "id": "<value>", "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0", "format": "slack", "organization_id": "<value>", "events": []}
3239+
"422":
3240+
application/json: {}
3241+
webhooks:get_webhook_endpoint:
3242+
speakeasy-default-webhooks:get-webhook-endpoint:
3243+
parameters:
3244+
path:
3245+
id: "<value>"
3246+
responses:
3247+
"200":
3248+
application/json: {"created_at": "2023-03-03T22:08:56.417Z", "modified_at": "2023-01-08T15:26:21.241Z", "id": "<value>", "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0", "format": "slack", "organization_id": "<value>", "events": []}
3249+
"404":
3250+
application/json: {"error": "ResourceNotFound", "detail": "<value>"}
3251+
"422":
3252+
application/json: {}
3253+
webhooks:update_webhook_endpoint:
3254+
speakeasy-default-webhooks:update-webhook-endpoint:
3255+
parameters:
3256+
path:
3257+
id: "<value>"
3258+
requestBody:
3259+
application/json: {"url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0", "secret": "f_z6mfSpxkjogyw3FkA2aH2gYE5huxruNf34MpdWMcA"}
3260+
responses:
3261+
"200":
3262+
application/json: {"created_at": "2023-03-16T20:44:41.718Z", "modified_at": "2023-02-18T12:18:32.442Z", "id": "<value>", "url": "https://webhook.site/cb791d80-f26e-4f8c-be88-6e56054192b0", "format": "slack", "organization_id": "<value>", "events": ["customer.updated"]}
3263+
"404":
3264+
application/json: {"error": "ResourceNotFound", "detail": "<value>"}
3265+
"422":
3266+
application/json: {}
3267+
webhooks:delete_webhook_endpoint:
3268+
speakeasy-default-webhooks:delete-webhook-endpoint:
3269+
parameters:
3270+
path:
3271+
id: "<value>"
3272+
responses:
3273+
"404":
3274+
application/json: {"error": "ResourceNotFound", "detail": "<value>"}
3275+
"422":
3276+
application/json: {}
3277+
webhooks:list_webhook_deliveries:
3278+
speakeasy-default-webhooks:list-webhook-deliveries:
3279+
parameters:
3280+
query:
3281+
page: 1
3282+
limit: 10
3283+
responses:
3284+
"200":
3285+
application/json: {"items": [], "pagination": {"total_count": 237575, "max_page": 794757}}
3286+
"422":
3287+
application/json: {}
3288+
webhooks:redeliver_webhook_event:
3289+
speakeasy-default-webhooks:redeliver-webhook-event:
3290+
parameters:
3291+
path:
3292+
id: "<value>"
3293+
responses:
3294+
"202":
3295+
application/json: "<value>"
3296+
"404":
3297+
application/json: {"error": "ResourceNotFound", "detail": "<value>"}
3298+
"422":
3299+
application/json: {}
31843300
examplesVersion: 1.0.2
31853301
generatedTests: {}

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ python:
3434
clientServerStatusCodesAsErrors: true
3535
defaultErrorName: SDKError
3636
description: Polar SDK for Python
37-
enableCustomCodeRegions: false
37+
enableCustomCodeRegions: true
3838
enumFormat: enum
3939
fixFlags:
4040
responseRequiredSep2024: true

.speakeasy/workflow.lock

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
speakeasyVersion: 1.561.0
1+
speakeasyVersion: 1.563.4
22
sources:
33
Polar-OAS:
44
sourceNamespace: polar-oas
5-
sourceRevisionDigest: sha256:be82026ed4ef09b552929e66286c3591d128c1f23cca14af95efba2bbc182f21
6-
sourceBlobDigest: sha256:ef6bc67a2bf0b327be3a4272993d89a60823fd8e3e9a3745f7db5c847a3c74e3
5+
sourceRevisionDigest: sha256:50876aa93820a1531cceb22927ff95061ee39fdf91b1b98f998637777a081ccd
6+
sourceBlobDigest: sha256:8706f707ed596def782532dc22b52a121947307bee250444df1ffd2a77cbedb4
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1749717182
109
- 0.1.0
1110
targets:
1211
polar:
1312
source: Polar-OAS
1413
sourceNamespace: polar-oas
15-
sourceRevisionDigest: sha256:be82026ed4ef09b552929e66286c3591d128c1f23cca14af95efba2bbc182f21
16-
sourceBlobDigest: sha256:ef6bc67a2bf0b327be3a4272993d89a60823fd8e3e9a3745f7db5c847a3c74e3
14+
sourceRevisionDigest: sha256:50876aa93820a1531cceb22927ff95061ee39fdf91b1b98f998637777a081ccd
15+
sourceBlobDigest: sha256:8706f707ed596def782532dc22b52a121947307bee250444df1ffd2a77cbedb4
1716
codeSamplesNamespace: polar-oas-py-code-samples
18-
codeSamplesRevisionDigest: sha256:72d79241613f63eeacc127852b883ab2f1c685506b847771068afcc8213a1eb0
17+
codeSamplesRevisionDigest: sha256:6570d1f3517b38955d1ce5d64d6ff12b6f0cf292486aecefcfd5339ef7333d34
1918
workflow:
2019
workflowVersion: 1.0.0
2120
speakeasyVersion: latest

.zed/settings.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@
44
"language_servers": ["pyright", "ruff", "!pylsp"],
55
"format_on_save": "on",
66
"wrap_guides": [88],
7-
"formatter": [
8-
{
9-
"code_actions": {
10-
"source.organizeImports.ruff": true,
11-
"source.fixAll.ruff": true
12-
}
13-
},
14-
{
15-
"language_server": {
16-
"name": "ruff"
17-
}
18-
}
19-
]
7+
"formatter": []
208
}
219
},
2210
"lsp": {

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,16 @@ def webhook():
933933
* [update](docs/sdks/subscriptions/README.md#update) - Update Subscription
934934
* [revoke](docs/sdks/subscriptions/README.md#revoke) - Revoke Subscription
935935

936+
### [webhooks](docs/sdks/webhooks/README.md)
937+
938+
* [list_webhook_endpoints](docs/sdks/webhooks/README.md#list_webhook_endpoints) - List Webhook Endpoints
939+
* [create_webhook_endpoint](docs/sdks/webhooks/README.md#create_webhook_endpoint) - Create Webhook Endpoint
940+
* [get_webhook_endpoint](docs/sdks/webhooks/README.md#get_webhook_endpoint) - Get Webhook Endpoint
941+
* [update_webhook_endpoint](docs/sdks/webhooks/README.md#update_webhook_endpoint) - Update Webhook Endpoint
942+
* [delete_webhook_endpoint](docs/sdks/webhooks/README.md#delete_webhook_endpoint) - Delete Webhook Endpoint
943+
* [list_webhook_deliveries](docs/sdks/webhooks/README.md#list_webhook_deliveries) - List Webhook Deliveries
944+
* [redeliver_webhook_event](docs/sdks/webhooks/README.md#redeliver_webhook_event) - Redeliver Webhook Event
945+
936946
</details>
937947
<!-- End Available Resources and Operations [operations] -->
938948

0 commit comments

Comments
 (0)