diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 73af8e74..e6522c4d 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: e7042734-e669-4c36-85da-bbb4a7500ac8 management: - docChecksum: 40302037f7ddd9eb946e36a3d56ad009 + docChecksum: c0b91f58fe2c7569b382da08ffc3aa77 docVersion: 0.1.0 - speakeasyVersion: 1.477.2 - generationVersion: 2.497.8 - releaseVersion: 0.13.4 - configChecksum: 5a00cb98a2cf113b51b8052211119233 + speakeasyVersion: 1.484.1 + generationVersion: 2.503.2 + releaseVersion: 0.13.5 + configChecksum: 95af5e424303d72d3e705c40107e31d7 repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git published: true @@ -14,13 +14,13 @@ features: python: additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.10.6 + core: 5.10.9 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 3.0.0 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 - flattening: 3.1.0 + flattening: 3.1.1 globalSecurity: 3.0.2 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 @@ -51,6 +51,7 @@ generatedFiles: - docs/models/advertisementslistrequest.md - docs/models/advertisementslistresponse.md - docs/models/advertisementsortproperty.md + - docs/models/aggregation.md - docs/models/alreadyactivesubscriptionerror.md - docs/models/alreadycanceledsubscription.md - docs/models/assignee.md @@ -195,7 +196,9 @@ generatedFiles: - docs/models/checkoutupdatemetadata.md - docs/models/checkoutupdatepublic.md - docs/models/checkoutupdatepubliccustomfielddata.md + - docs/models/clauses.md - docs/models/conditions.md + - docs/models/countaggregation.md - docs/models/currencyamount.md - docs/models/customer.md - docs/models/customerbenefitgrant.md @@ -372,7 +375,24 @@ generatedFiles: - docs/models/downloadablefilecreate.md - docs/models/downloadablefileread.md - docs/models/downloadableread.md + - docs/models/event.md + - docs/models/eventcreatecustomer.md + - docs/models/eventcreatecustomermetadata.md + - docs/models/eventcreateexternalcustomer.md + - docs/models/eventcreateexternalcustomermetadata.md + - docs/models/eventmetadata.md + - docs/models/eventsgetrequest.md + - docs/models/eventsingest.md + - docs/models/eventsingestresponse.md + - docs/models/eventslistqueryparamcustomeridfilter.md + - docs/models/eventslistqueryparamorganizationidfilter.md + - docs/models/eventslistrequest.md + - docs/models/eventslistresponse.md + - docs/models/eventsmodel.md + - docs/models/eventsortproperty.md + - docs/models/eventsource.md - docs/models/existingproductprice.md + - docs/models/externalcustomeridfilter.md - docs/models/externalorganization.md - docs/models/externalorganizationnamefilter.md - docs/models/externalorganizationslistrequest.md @@ -392,10 +412,14 @@ generatedFiles: - docs/models/filesuploadedresponsefilesuploaded.md - docs/models/fileupload.md - docs/models/fileuploadcompleted.md + - docs/models/filter_.md + - docs/models/filterclause.md + - docs/models/filterconjunction.md + - docs/models/filteroperator.md + - docs/models/func.md - docs/models/funding.md - docs/models/granttypes.md - docs/models/httpvalidationerror.md - - docs/models/interval.md - docs/models/introspecttokenresponse.md - docs/models/issue.md - docs/models/label.md @@ -432,9 +456,11 @@ generatedFiles: - docs/models/listresourcecustomfield.md - docs/models/listresourcediscount.md - docs/models/listresourcedownloadableread.md + - docs/models/listresourceevent.md - docs/models/listresourceexternalorganization.md - docs/models/listresourcefileread.md - docs/models/listresourcelicensekeyread.md + - docs/models/listresourcemeter.md - docs/models/listresourceoauth2client.md - docs/models/listresourceorder.md - docs/models/listresourceorganization.md @@ -446,6 +472,26 @@ generatedFiles: - docs/models/meta.md - docs/models/metadata.md - docs/models/metadataquery.md + - docs/models/meter.md + - docs/models/meteraggregation.md + - docs/models/metercreate.md + - docs/models/metercreateaggregation.md + - docs/models/metercreatemetadata.md + - docs/models/metermetadata.md + - docs/models/meterquantities.md + - docs/models/meterquantity.md + - docs/models/meterseventsrequest.md + - docs/models/meterseventsresponse.md + - docs/models/metersgetrequest.md + - docs/models/meterslistqueryparamorganizationidfilter.md + - docs/models/meterslistrequest.md + - docs/models/meterslistresponse.md + - docs/models/metersortproperty.md + - docs/models/metersquantitiesqueryparamcustomeridfilter.md + - docs/models/metersquantitiesrequest.md + - docs/models/metersupdaterequest.md + - docs/models/meterupdate.md + - docs/models/meterupdatemetadata.md - docs/models/metric.md - docs/models/metricperiod.md - docs/models/metrics.md @@ -568,10 +614,12 @@ generatedFiles: - docs/models/productupdatemetadata.md - docs/models/productupdateprices.md - docs/models/properties.md + - docs/models/propertyaggregation.md - docs/models/queryparambenefitidfilter.md - docs/models/queryparambenefittypefilter.md - docs/models/queryparamcustomeridfilter.md - docs/models/queryparamdiscountidfilter.md + - docs/models/queryparamexternalcustomeridfilter.md - docs/models/queryparamorderidfilter.md - docs/models/queryparamorganizationidfilter.md - docs/models/queryparamplatformfilter.md @@ -614,6 +662,7 @@ generatedFiles: - docs/models/s3fileuploadpart.md - docs/models/scope.md - docs/models/security.md + - docs/models/sourcefilter.md - docs/models/state.md - docs/models/subscription.md - docs/models/subscriptioncancel.md @@ -639,6 +688,7 @@ generatedFiles: - docs/models/taxid.md - docs/models/taxidformat.md - docs/models/timeframe.md + - docs/models/timeinterval.md - docs/models/tokenendpointauthmethod.md - docs/models/tokenresponse.md - docs/models/tokentype.md @@ -649,6 +699,7 @@ generatedFiles: - docs/models/utils/retryconfig.md - docs/models/validatedlicensekey.md - docs/models/validationerror.md + - docs/models/value.md - docs/models/webhookbenefitcreatedpayload.md - docs/models/webhookbenefitgrantcreatedpayload.md - docs/models/webhookbenefitgrantrevokedpayload.md @@ -684,9 +735,11 @@ generatedFiles: - docs/sdks/customfields/README.md - docs/sdks/discounts/README.md - docs/sdks/downloadables/README.md + - docs/sdks/events/README.md - docs/sdks/externalorganizations/README.md - docs/sdks/files/README.md - docs/sdks/licensekeys/README.md + - docs/sdks/meters/README.md - docs/sdks/metricssdk/README.md - docs/sdks/oauth2/README.md - docs/sdks/orders/README.md @@ -726,10 +779,12 @@ generatedFiles: - src/polar_sdk/customers.py - src/polar_sdk/discounts.py - src/polar_sdk/downloadables.py + - src/polar_sdk/events.py - src/polar_sdk/external_organizations.py - src/polar_sdk/files.py - src/polar_sdk/httpclient.py - src/polar_sdk/license_keys.py + - src/polar_sdk/meters.py - src/polar_sdk/metrics_sdk.py - src/polar_sdk/models/__init__.py - src/polar_sdk/models/address.py @@ -843,6 +898,7 @@ generatedFiles: - src/polar_sdk/models/checkoutstatus.py - src/polar_sdk/models/checkoutupdate.py - src/polar_sdk/models/checkoutupdatepublic.py + - src/polar_sdk/models/countaggregation.py - src/polar_sdk/models/currencyamount.py - src/polar_sdk/models/custom_fields_deleteop.py - src/polar_sdk/models/custom_fields_getop.py @@ -957,6 +1013,14 @@ generatedFiles: - src/polar_sdk/models/downloadablefilecreate.py - src/polar_sdk/models/downloadablefileread.py - src/polar_sdk/models/downloadableread.py + - src/polar_sdk/models/event.py + - src/polar_sdk/models/eventcreatecustomer.py + - src/polar_sdk/models/eventcreateexternalcustomer.py + - src/polar_sdk/models/events_getop.py + - src/polar_sdk/models/eventsingest.py + - src/polar_sdk/models/eventsingestresponse.py + - src/polar_sdk/models/eventsortproperty.py + - src/polar_sdk/models/eventsource.py - src/polar_sdk/models/existingproductprice.py - src/polar_sdk/models/external_organizations_listop.py - src/polar_sdk/models/externalorganization.py @@ -971,9 +1035,12 @@ generatedFiles: - src/polar_sdk/models/fileservicetypes.py - src/polar_sdk/models/fileupload.py - src/polar_sdk/models/fileuploadcompleted.py + - src/polar_sdk/models/filter_.py + - src/polar_sdk/models/filterclause.py + - src/polar_sdk/models/filterconjunction.py + - src/polar_sdk/models/filteroperator.py - src/polar_sdk/models/funding.py - src/polar_sdk/models/httpvalidationerror.py - - src/polar_sdk/models/interval.py - src/polar_sdk/models/introspecttokenresponse.py - src/polar_sdk/models/issue.py - src/polar_sdk/models/label.py @@ -1003,9 +1070,11 @@ generatedFiles: - src/polar_sdk/models/listresource_customfield_.py - src/polar_sdk/models/listresource_discount_.py - src/polar_sdk/models/listresource_downloadableread_.py + - src/polar_sdk/models/listresource_event_.py - src/polar_sdk/models/listresource_externalorganization_.py - src/polar_sdk/models/listresource_fileread_.py - src/polar_sdk/models/listresource_licensekeyread_.py + - src/polar_sdk/models/listresource_meter_.py - src/polar_sdk/models/listresource_oauth2client_.py - src/polar_sdk/models/listresource_order_.py - src/polar_sdk/models/listresource_organization_.py @@ -1013,6 +1082,16 @@ generatedFiles: - src/polar_sdk/models/listresource_refund_.py - src/polar_sdk/models/listresource_repository_.py - src/polar_sdk/models/listresource_subscription_.py + - src/polar_sdk/models/meter.py + - src/polar_sdk/models/metercreate.py + - src/polar_sdk/models/meterquantities.py + - src/polar_sdk/models/meterquantity.py + - src/polar_sdk/models/meters_eventsop.py + - src/polar_sdk/models/meters_getop.py + - src/polar_sdk/models/meters_quantitiesop.py + - src/polar_sdk/models/meters_updateop.py + - src/polar_sdk/models/metersortproperty.py + - src/polar_sdk/models/meterupdate.py - src/polar_sdk/models/metric.py - src/polar_sdk/models/metricperiod.py - src/polar_sdk/models/metrics.py @@ -1097,6 +1176,7 @@ generatedFiles: - src/polar_sdk/models/products_updateop.py - src/polar_sdk/models/productsortproperty.py - src/polar_sdk/models/productupdate.py + - src/polar_sdk/models/propertyaggregation.py - src/polar_sdk/models/reactions.py - src/polar_sdk/models/refund.py - src/polar_sdk/models/refundamounttoohigh.py @@ -1143,6 +1223,7 @@ generatedFiles: - src/polar_sdk/models/subscriptionuser.py - src/polar_sdk/models/subtype.py - src/polar_sdk/models/taxidformat.py + - src/polar_sdk/models/timeinterval.py - src/polar_sdk/models/tokenresponse.py - src/polar_sdk/models/unauthorized.py - src/polar_sdk/models/userinfoorganization.py @@ -1576,7 +1657,7 @@ examples: speakeasy-default-oauth2-:authorize: responses: "200": - application/json: {"client": {"created_at": "2023-05-14T00:33:15.801Z", "modified_at": "2023-01-08T10:23:26.945Z", "client_id": "", "client_name": "", "client_uri": "https://thrifty-excess.biz/", "logo_uri": "https://zany-morbidity.info/", "tos_uri": "https://noted-digit.com/", "policy_uri": "https://that-airmail.info"}, "sub": {"id": "", "email": "Frederic48@hotmail.com", "avatar_url": "https://burdensome-institute.info"}, "scopes": ["license_keys:read", "checkout_links:write"]} + application/json: {"client": {"created_at": "2023-05-14T00:33:15.801Z", "modified_at": "2023-01-08T10:23:26.945Z", "client_id": "", "client_name": "", "client_uri": "https://thrifty-excess.biz/", "logo_uri": "https://zany-morbidity.info/", "tos_uri": "https://noted-digit.com/", "policy_uri": "https://that-airmail.info"}, "sub": {"id": "", "email": "Frederic48@hotmail.com", "avatar_url": "https://burdensome-institute.info"}, "scopes": ["external_organizations:read", "checkouts:read"]} oauth2:request_token: speakeasy-default-oauth2-:request-token: requestBody: @@ -1927,7 +2008,7 @@ examples: client_secret: "" responses: "200": - application/json: {"created_at": "2023-06-23T19:45:02.115Z", "modified_at": "2023-11-26T05:04:17.930Z", "id": "", "payment_processor": "stripe", "status": "succeeded", "client_secret": "", "url": "https://firm-median.name", "expires_at": "2025-10-05T02:43:03.106Z", "success_url": "https://distinct-release.info", "embed_origin": "", "amount": 649087, "tax_amount": 818651, "currency": "Costa Rican Colon", "subtotal_amount": 643894, "total_amount": 773661, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": true, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "French Guiana"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": ""}, "product": {"created_at": "2023-10-13T16:57:32.051Z", "modified_at": "2025-11-01T11:47:43.290Z", "id": "", "name": "", "description": "triumphantly rise energetically where", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-04-14T21:02:40.457Z", "modified_at": "2024-08-06T16:01:01.665Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 564186, "recurring_interval": "year"}, {"created_at": "2023-08-09T10:44:49.155Z", "modified_at": "2025-03-23T07:06:26.009Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 649087, "maximum_amount": 818651, "preset_amount": 200899}, {"created_at": "2025-01-06T03:44:33.409Z", "modified_at": "2024-03-14T11:17:47.100Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [{"created_at": "2025-07-05T20:16:55.610Z", "modified_at": "2024-09-19T12:59:12.930Z", "id": "", "type": "custom", "description": "reporter gee among house incidentally", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-07-23T16:17:04.686Z", "modified_at": "2025-10-15T01:25:33.429Z", "id": "", "type": "discord", "description": "definitive as fluffy", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/share", "mime_type": "", "size": 625185, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-05-17T14:56:37.099Z", "version": "", "is_uploaded": true, "created_at": "2024-03-07T06:13:50.940Z", "size_readable": "", "public_url": "https://creamy-giant.biz"}]}, "product_price": {"created_at": "2025-10-11T12:01:20.600Z", "modified_at": "2023-12-09T12:49:04.135Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 260681}, "discount": {"duration": "forever", "duration_in_months": 442095, "type": "fixed", "basis_points": 565670, "id": "", "name": "", "code": ""}, "organization": {"created_at": "2023-06-12T01:20:42.663Z", "modified_at": "2023-02-21T05:50:56.610Z", "id": "", "name": "", "slug": "", "avatar_url": "https://bouncy-thyme.info/", "bio": "", "company": "Kerluke, Mayert and Langosh", "blog": "", "location": "", "email": "Kaylee_Cassin36@gmail.com", "twitter_username": "", "pledge_minimum_amount": 449940, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 614629, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "prorate"}}, "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-11-05T08:59:00.297Z", "modified_at": "2025-03-24T21:11:57.960Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 487179, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2025-07-02T20:33:07.976Z", "modified_at": "2024-04-05T14:47:54.334Z", "id": "", "metadata": {"key": 356483, "key1": "", "key2": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 415445, "required": true}]} + application/json: {"created_at": "2023-06-23T19:45:02.115Z", "modified_at": "2023-11-26T05:04:17.930Z", "id": "", "payment_processor": "stripe", "status": "succeeded", "client_secret": "", "url": "https://firm-median.name", "expires_at": "2025-10-05T02:43:03.106Z", "success_url": "https://distinct-release.info", "embed_origin": "", "amount": 649087, "tax_amount": 818651, "currency": "Costa Rican Colon", "subtotal_amount": 643894, "total_amount": 773661, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": true, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "French Guiana"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": ""}, "product": {"created_at": "2023-10-13T16:57:32.051Z", "modified_at": "2025-11-01T11:47:43.290Z", "id": "", "name": "", "description": "triumphantly rise energetically where", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-04-14T21:02:40.457Z", "modified_at": "2024-08-06T16:01:01.665Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 564186, "recurring_interval": "year"}, {"created_at": "2023-08-09T10:44:49.155Z", "modified_at": "2025-03-23T07:06:26.009Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 649087, "maximum_amount": 818651, "preset_amount": 200899}, {"created_at": "2025-01-06T03:44:33.409Z", "modified_at": "2024-03-14T11:17:47.100Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [{"created_at": "2025-07-05T20:16:55.610Z", "modified_at": "2024-09-19T12:59:12.930Z", "id": "", "type": "custom", "description": "reporter gee among house incidentally", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-07-23T16:17:04.686Z", "modified_at": "2025-10-15T01:25:33.429Z", "id": "", "type": "discord", "description": "definitive as fluffy", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/share", "mime_type": "", "size": 625185, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-05-17T14:56:37.099Z", "version": "", "is_uploaded": true, "created_at": "2024-03-07T06:13:50.940Z", "size_readable": "", "public_url": "https://creamy-giant.biz"}]}, "product_price": {"created_at": "2025-10-11T12:01:20.600Z", "modified_at": "2023-12-09T12:49:04.135Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 260681}, "discount": {"duration": "forever", "duration_in_months": 442095, "type": "fixed", "basis_points": 565670, "id": "", "name": "", "code": ""}, "organization": {"created_at": "2023-06-12T01:20:42.663Z", "modified_at": "2023-02-21T05:50:56.610Z", "id": "", "name": "", "slug": "", "avatar_url": "https://bouncy-thyme.info/", "bio": "", "company": "Kerluke, Mayert and Langosh", "blog": "", "location": "", "email": "Kaylee_Cassin36@gmail.com", "twitter_username": "", "pledge_minimum_amount": 449940, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 614629, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "prorate"}}, "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-05-26T18:30:39.536Z", "modified_at": "2025-09-06T08:48:06.798Z", "id": "", "metadata": {"key": 742595}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 487179, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-10-02T19:30:27.681Z", "modified_at": "2025-07-02T20:33:07.976Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 415445, "required": true}]} "404": application/json: {"detail": ""} "422": @@ -1941,7 +2022,7 @@ examples: application/json: {} responses: "200": - application/json: {"created_at": "2025-10-22T20:45:21.815Z", "modified_at": "2024-07-16T23:31:05.499Z", "id": "", "payment_processor": "stripe", "status": "expired", "client_secret": "", "url": "https://energetic-nectarine.org", "expires_at": "2023-07-02T09:01:58.946Z", "success_url": "https://unsteady-reservation.net", "embed_origin": "", "amount": 169287, "tax_amount": 984514, "currency": "Naira", "subtotal_amount": 839103, "total_amount": 574252, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": true, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Ecuador"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": "", "key2": ""}, "product": {"created_at": "2023-04-02T09:15:44.014Z", "modified_at": "2023-07-09T01:19:03.728Z", "id": "", "name": "", "description": "till after well-documented under though ah inspect", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-11-16T20:51:18.745Z", "modified_at": "2024-07-13T01:44:24.320Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 597177, "maximum_amount": 947630, "preset_amount": 166401}, {"created_at": "2025-04-03T02:37:24.726Z", "modified_at": "2025-06-10T04:54:08.615Z", "id": "", "is_archived": true, "product_id": ""}, {"created_at": "2025-07-08T15:45:04.860Z", "modified_at": "2024-09-21T09:06:50.882Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 508864, "maximum_amount": 744619, "preset_amount": 137234}], "benefits": [{"created_at": "2023-03-15T12:20:36.952Z", "modified_at": "2025-05-20T04:50:42.884Z", "id": "", "type": "custom", "description": "petticoat probable gently polyester aw although shoulder", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2024-11-19T07:53:51.394Z", "modified_at": "2025-03-11T10:27:43.078Z", "id": "", "type": "discord", "description": "that meanwhile receptor futon orchestrate since slushy surprised ick", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt", "mime_type": "", "size": 197645, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-11-16T03:17:08.766Z", "version": "", "is_uploaded": true, "created_at": "2023-08-26T11:13:36.032Z", "size_readable": "", "public_url": "https://knotty-vicinity.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/opt/lib", "mime_type": "", "size": 859643, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-29T16:21:18.296Z", "version": "", "is_uploaded": true, "created_at": "2024-06-11T19:24:10.100Z", "size_readable": "", "public_url": "https://grounded-soybean.com"}, {"id": "", "organization_id": "", "name": "", "path": "/lib", "mime_type": "", "size": 560820, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-13T08:26:39.160Z", "version": "", "is_uploaded": false, "created_at": "2025-06-24T16:48:30.542Z", "size_readable": "", "public_url": "https://lost-bathhouse.org"}]}, "product_price": {"created_at": "2023-10-09T22:41:34.766Z", "modified_at": "2025-06-14T00:54:00.547Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 172495}, "discount": {"duration": "forever", "duration_in_months": 37700, "type": "percentage", "amount": 999915, "currency": "New Taiwan Dollar", "id": "", "name": "", "code": ""}, "organization": {"created_at": "2025-10-06T00:49:46.530Z", "modified_at": "2025-06-18T09:23:32.088Z", "id": "", "name": "", "slug": "", "avatar_url": "https://grim-hierarchy.org", "bio": "", "company": "Cummerata, O'Hara and Bartell", "blog": "", "location": "", "email": "Rosemarie34@gmail.com", "twitter_username": "", "pledge_minimum_amount": 970203, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 329221, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "invoice"}}, "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-07-18T14:46:38.829Z", "modified_at": "2024-12-24T03:42:50.687Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 190984, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-04-16T00:02:14.300Z", "modified_at": "2024-08-11T23:08:29.689Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 91865, "required": false}]} + application/json: {"created_at": "2025-10-22T20:45:21.815Z", "modified_at": "2024-07-16T23:31:05.499Z", "id": "", "payment_processor": "stripe", "status": "expired", "client_secret": "", "url": "https://energetic-nectarine.org", "expires_at": "2023-07-02T09:01:58.946Z", "success_url": "https://unsteady-reservation.net", "embed_origin": "", "amount": 169287, "tax_amount": 984514, "currency": "Naira", "subtotal_amount": 839103, "total_amount": 574252, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": true, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Ecuador"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": "", "key2": ""}, "product": {"created_at": "2023-04-02T09:15:44.014Z", "modified_at": "2023-07-09T01:19:03.728Z", "id": "", "name": "", "description": "till after well-documented under though ah inspect", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-11-16T20:51:18.745Z", "modified_at": "2024-07-13T01:44:24.320Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 597177, "maximum_amount": 947630, "preset_amount": 166401}, {"created_at": "2025-04-03T02:37:24.726Z", "modified_at": "2025-06-10T04:54:08.615Z", "id": "", "is_archived": true, "product_id": ""}, {"created_at": "2025-07-08T15:45:04.860Z", "modified_at": "2024-09-21T09:06:50.882Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 508864, "maximum_amount": 744619, "preset_amount": 137234}], "benefits": [{"created_at": "2023-03-15T12:20:36.952Z", "modified_at": "2025-05-20T04:50:42.884Z", "id": "", "type": "custom", "description": "petticoat probable gently polyester aw although shoulder", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2024-11-19T07:53:51.394Z", "modified_at": "2025-03-11T10:27:43.078Z", "id": "", "type": "discord", "description": "that meanwhile receptor futon orchestrate since slushy surprised ick", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt", "mime_type": "", "size": 197645, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-11-16T03:17:08.766Z", "version": "", "is_uploaded": true, "created_at": "2023-08-26T11:13:36.032Z", "size_readable": "", "public_url": "https://knotty-vicinity.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/opt/lib", "mime_type": "", "size": 859643, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-29T16:21:18.296Z", "version": "", "is_uploaded": true, "created_at": "2024-06-11T19:24:10.100Z", "size_readable": "", "public_url": "https://grounded-soybean.com"}, {"id": "", "organization_id": "", "name": "", "path": "/lib", "mime_type": "", "size": 560820, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-13T08:26:39.160Z", "version": "", "is_uploaded": false, "created_at": "2025-06-24T16:48:30.542Z", "size_readable": "", "public_url": "https://lost-bathhouse.org"}]}, "product_price": {"created_at": "2023-10-09T22:41:34.766Z", "modified_at": "2025-06-14T00:54:00.547Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 172495}, "discount": {"duration": "forever", "duration_in_months": 37700, "type": "percentage", "amount": 999915, "currency": "New Taiwan Dollar", "id": "", "name": "", "code": ""}, "organization": {"created_at": "2025-10-06T00:49:46.530Z", "modified_at": "2025-06-18T09:23:32.088Z", "id": "", "name": "", "slug": "", "avatar_url": "https://grim-hierarchy.org", "bio": "", "company": "Cummerata, O'Hara and Bartell", "blog": "", "location": "", "email": "Rosemarie34@gmail.com", "twitter_username": "", "pledge_minimum_amount": 970203, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 329221, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "invoice"}}, "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-07-17T07:58:43.752Z", "modified_at": "2023-01-25T05:31:14.324Z", "id": "", "metadata": {"key": "", "key1": 288739, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 190984, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-10-25T18:06:03.198Z", "modified_at": "2024-04-16T00:02:14.300Z", "id": "", "metadata": {"key": "", "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 91865, "required": false}]} "404": application/json: {"detail": ""} "422": @@ -2469,7 +2550,7 @@ examples: limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "amount": 177706, "tax_amount": 229716, "currency": "Belize Dollar", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2024-11-27T13:02:27.296Z", "modified_at": "2024-12-01T18:25:37.169Z", "id": "", "name": "", "description": "accountability pish likewise", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-05-29T14:05:29.727Z", "modified_at": "2024-05-19T11:06:26.987Z", "id": "", "type": "discord", "description": "beside tromp worth reluctantly wound accompanist", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2025-05-02T01:42:40.060Z", "modified_at": "2024-07-08T07:59:15.466Z", "id": "", "type": "license_keys", "description": "angrily inasmuch irritably finally round alongside whoever jump joyfully discourse", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2025-06-02T11:43:36.892Z", "modified_at": "2025-09-08T09:13:39.168Z", "id": "", "type": "downloadables", "description": "finally earth that early", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2024-12-11T21:57:01.257Z", "modified_at": "2024-03-23T19:09:17.797Z", "id": "", "name": "", "slug": "", "avatar_url": "https://acceptable-validity.info/", "bio": "", "company": "Vandervort, Feest and Johns", "blog": "", "location": "", "email": "Aimee_DAmore62@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 140142, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 29339, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2023-06-17T12:14:27.999Z", "modified_at": "2024-11-27T13:02:27.296Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 17577, "recurring_interval": "year"}, "subscription": {"created_at": "2024-04-27T12:09:29.137Z", "modified_at": "2024-03-30T01:03:36.657Z", "id": "", "amount": 253529, "currency": "Tugrik", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-06-16T22:11:32.719Z", "current_period_end": "2025-10-03T23:44:36.269Z", "cancel_at_period_end": false, "canceled_at": "2024-06-18T04:12:45.071Z", "started_at": "2025-12-03T09:47:00.347Z", "ends_at": "2023-09-13T06:39:19.968Z", "ended_at": "2023-01-21T07:06:12.853Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": ""}}, {"created_at": "2024-11-12T02:36:59.348Z", "modified_at": "2025-07-01T16:47:46.535Z", "id": "", "amount": 877227, "tax_amount": 767546, "currency": "Jamaican Dollar", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2025-10-29T17:09:20.090Z", "modified_at": "2023-11-06T03:01:50.647Z", "id": "", "name": "", "description": "glow warmhearted apud house for", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-01-24T00:05:25.844Z", "modified_at": "2024-07-12T19:57:33.016Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 7468, "recurring_interval": "month"}, {"created_at": "2023-03-22T06:10:55.267Z", "modified_at": "2025-10-17T13:20:28.265Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 876407, "maximum_amount": 490078, "preset_amount": 51681, "recurring_interval": "month"}, {"created_at": "2025-09-10T07:49:25.657Z", "modified_at": "2024-04-10T02:32:42.816Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 173090}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home", "mime_type": "", "size": 107335, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-27T02:37:34.714Z", "version": "", "is_uploaded": true, "created_at": "2025-01-08T00:53:45.951Z", "size_readable": "", "public_url": "https://friendly-shipper.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/sbin", "mime_type": "", "size": 52444, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-14T09:01:42.858Z", "version": "", "is_uploaded": false, "created_at": "2025-09-13T01:21:21.360Z", "size_readable": "", "public_url": "https://shadowy-formamide.info"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/local/bin", "mime_type": "", "size": 477827, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-05-14T13:28:52.523Z", "version": "", "is_uploaded": true, "created_at": "2024-01-12T23:45:01.413Z", "size_readable": "", "public_url": "https://agreeable-squid.net"}], "organization": {"created_at": "2024-12-31T03:06:35.935Z", "modified_at": "2024-06-28T21:52:26.059Z", "id": "", "name": "", "slug": "", "avatar_url": "https://every-affiliate.org", "bio": "", "company": "Denesik, Kertzmann and Flatley", "blog": "", "location": "", "email": "Alexandria_Rowe81@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 624246, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 88338, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}}}, "product_price": {"created_at": "2024-04-19T11:47:41.889Z", "modified_at": "2024-06-10T18:07:18.321Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 523875, "maximum_amount": 841031, "preset_amount": 410206, "recurring_interval": "year"}, "subscription": {"created_at": "2023-05-23T19:32:31.453Z", "modified_at": "2024-08-14T18:41:19.055Z", "id": "", "amount": 387926, "currency": "Kwacha", "recurring_interval": "month", "status": "canceled", "current_period_start": "2024-12-19T21:19:09.188Z", "current_period_end": "2023-10-19T07:09:33.817Z", "cancel_at_period_end": true, "canceled_at": "2023-09-26T08:19:08.306Z", "started_at": "2025-03-08T08:44:16.186Z", "ends_at": "2023-05-07T21:01:22.996Z", "ended_at": "2023-04-17T02:32:11.293Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}}, {"created_at": "2023-11-28T08:17:13.465Z", "modified_at": "2025-07-17T07:32:23.211Z", "id": "", "amount": 107757, "tax_amount": 890478, "currency": "CFA Franc BEAC", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2025-01-12T22:29:09.717Z", "modified_at": "2025-10-02T21:48:51.327Z", "id": "", "name": "", "description": "until graffiti gee afore when rosy insignificant uh-huh", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-05-05T09:08:16.530Z", "modified_at": "2023-07-18T12:08:53.113Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 33597, "maximum_amount": 628106, "preset_amount": 934960, "recurring_interval": "year"}, {"created_at": "2024-09-14T04:48:08.824Z", "modified_at": "2025-07-08T11:13:00.198Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, {"created_at": "2023-03-23T01:47:30.770Z", "modified_at": "2025-07-06T02:51:23.749Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 141764, "recurring_interval": "year"}], "benefits": [{"created_at": "2023-11-03T23:20:28.461Z", "modified_at": "2023-06-03T07:49:02.697Z", "id": "", "type": "license_keys", "description": "mid next dearly competent tender right plump", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 113341, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-02T17:02:41.566Z", "version": "", "is_uploaded": true, "created_at": "2024-10-06T22:24:47.498Z", "size_readable": "", "public_url": "https://skeletal-commercial.net"}], "organization": {"created_at": "2023-03-22T00:14:34.859Z", "modified_at": "2024-05-17T10:01:40.294Z", "id": "", "name": "", "slug": "", "avatar_url": "https://wry-dividend.name/", "bio": "", "company": "Gerhold - Bergstrom", "blog": "", "location": "", "email": "Ole_Legros@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 747687, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 726474, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2023-11-19T07:34:10.466Z", "modified_at": "2025-12-24T15:52:28.107Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 258945, "recurring_interval": "month"}, "subscription": {"created_at": "2025-06-20T20:39:56.038Z", "modified_at": "2025-02-23T13:40:33.504Z", "id": "", "amount": 223595, "currency": "Tugrik", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-04-16T22:12:09.039Z", "current_period_end": "2024-01-09T21:57:02.179Z", "cancel_at_period_end": true, "canceled_at": "2025-02-06T05:52:39.668Z", "started_at": "2023-03-10T23:54:55.605Z", "ends_at": "2025-11-07T00:43:09.247Z", "ended_at": "2025-09-16T08:39:57.875Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": ""}}], "pagination": {"total_count": 656093, "max_page": 191255}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "amount": 177706, "tax_amount": 229716, "currency": "Belize Dollar", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2024-11-27T13:02:27.296Z", "modified_at": "2024-12-01T18:25:37.169Z", "id": "", "name": "", "description": "accountability pish likewise", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-05-29T14:05:29.727Z", "modified_at": "2024-05-19T11:06:26.987Z", "id": "", "type": "discord", "description": "beside tromp worth reluctantly wound accompanist", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2025-05-02T01:42:40.060Z", "modified_at": "2024-07-08T07:59:15.466Z", "id": "", "type": "license_keys", "description": "angrily inasmuch irritably finally round alongside whoever jump joyfully discourse", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2025-06-02T11:43:36.892Z", "modified_at": "2025-09-08T09:13:39.168Z", "id": "", "type": "downloadables", "description": "finally earth that early", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2024-12-11T21:57:01.257Z", "modified_at": "2024-03-23T19:09:17.797Z", "id": "", "name": "", "slug": "", "avatar_url": "https://acceptable-validity.info/", "bio": "", "company": "Vandervort, Feest and Johns", "blog": "", "location": "", "email": "Aimee_DAmore62@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 140142, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 29339, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2025-01-13T10:26:00.433Z", "modified_at": "2023-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, "subscription": {"created_at": "2024-04-27T12:09:29.137Z", "modified_at": "2024-03-30T01:03:36.657Z", "id": "", "amount": 253529, "currency": "Tugrik", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-06-16T22:11:32.719Z", "current_period_end": "2025-10-03T23:44:36.269Z", "cancel_at_period_end": false, "canceled_at": "2024-06-18T04:12:45.071Z", "started_at": "2025-12-03T09:47:00.347Z", "ends_at": "2023-09-13T06:39:19.968Z", "ended_at": "2023-01-21T07:06:12.853Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": ""}}, {"created_at": "2024-11-12T02:36:59.348Z", "modified_at": "2025-07-01T16:47:46.535Z", "id": "", "amount": 877227, "tax_amount": 767546, "currency": "Jamaican Dollar", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2025-10-29T17:09:20.090Z", "modified_at": "2023-11-06T03:01:50.647Z", "id": "", "name": "", "description": "glow warmhearted apud house for", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-04-05T09:49:38.010Z", "modified_at": "2023-03-17T01:57:00.187Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, {"created_at": "2023-03-01T20:22:54.911Z", "modified_at": "2024-02-08T01:09:52.088Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 73227}, {"created_at": "2025-08-18T13:00:42.665Z", "modified_at": "2024-06-21T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home", "mime_type": "", "size": 107335, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-27T02:37:34.714Z", "version": "", "is_uploaded": true, "created_at": "2025-01-08T00:53:45.951Z", "size_readable": "", "public_url": "https://friendly-shipper.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/sbin", "mime_type": "", "size": 52444, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-14T09:01:42.858Z", "version": "", "is_uploaded": false, "created_at": "2025-09-13T01:21:21.360Z", "size_readable": "", "public_url": "https://shadowy-formamide.info"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/local/bin", "mime_type": "", "size": 477827, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-05-14T13:28:52.523Z", "version": "", "is_uploaded": true, "created_at": "2024-01-12T23:45:01.413Z", "size_readable": "", "public_url": "https://agreeable-squid.net"}], "organization": {"created_at": "2024-12-31T03:06:35.935Z", "modified_at": "2024-06-28T21:52:26.059Z", "id": "", "name": "", "slug": "", "avatar_url": "https://every-affiliate.org", "bio": "", "company": "Denesik, Kertzmann and Flatley", "blog": "", "location": "", "email": "Alexandria_Rowe81@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 624246, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 88338, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}}}, "product_price": {"created_at": "2025-09-28T03:47:03.515Z", "modified_at": "2023-07-09T16:58:41.012Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 897069, "maximum_amount": 135572, "preset_amount": 460276}, "subscription": {"created_at": "2023-05-23T19:32:31.453Z", "modified_at": "2024-08-14T18:41:19.055Z", "id": "", "amount": 387926, "currency": "Kwacha", "recurring_interval": "month", "status": "canceled", "current_period_start": "2024-12-19T21:19:09.188Z", "current_period_end": "2023-10-19T07:09:33.817Z", "cancel_at_period_end": true, "canceled_at": "2023-09-26T08:19:08.306Z", "started_at": "2025-03-08T08:44:16.186Z", "ends_at": "2023-05-07T21:01:22.996Z", "ended_at": "2023-04-17T02:32:11.293Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": ""}}, {"created_at": "2023-11-28T08:17:13.465Z", "modified_at": "2025-07-17T07:32:23.211Z", "id": "", "amount": 107757, "tax_amount": 890478, "currency": "CFA Franc BEAC", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2025-01-12T22:29:09.717Z", "modified_at": "2025-10-02T21:48:51.327Z", "id": "", "name": "", "description": "until graffiti gee afore when rosy insignificant uh-huh", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-06-10T18:07:18.321Z", "modified_at": "2023-04-24T08:24:21.019Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 841031, "maximum_amount": 410206, "preset_amount": 863466, "recurring_interval": "month"}, {"created_at": "2023-07-18T12:08:53.113Z", "modified_at": "2025-09-28T13:56:10.162Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 628106, "recurring_interval": "year"}, {"created_at": "2025-01-29T10:30:11.361Z", "modified_at": "2024-09-14T04:48:08.824Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 816637}], "benefits": [{"created_at": "2023-11-03T23:20:28.461Z", "modified_at": "2023-06-03T07:49:02.697Z", "id": "", "type": "license_keys", "description": "mid next dearly competent tender right plump", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 113341, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-02T17:02:41.566Z", "version": "", "is_uploaded": true, "created_at": "2024-10-06T22:24:47.498Z", "size_readable": "", "public_url": "https://skeletal-commercial.net"}], "organization": {"created_at": "2023-03-22T00:14:34.859Z", "modified_at": "2024-05-17T10:01:40.294Z", "id": "", "name": "", "slug": "", "avatar_url": "https://wry-dividend.name/", "bio": "", "company": "Gerhold - Bergstrom", "blog": "", "location": "", "email": "Ole_Legros@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 747687, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 726474, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2023-06-30T19:14:35.502Z", "modified_at": "2023-03-23T01:47:30.770Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 777245}, "subscription": {"created_at": "2025-06-20T20:39:56.038Z", "modified_at": "2025-02-23T13:40:33.504Z", "id": "", "amount": 223595, "currency": "Tugrik", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-04-16T22:12:09.039Z", "current_period_end": "2024-01-09T21:57:02.179Z", "cancel_at_period_end": true, "canceled_at": "2025-02-06T05:52:39.668Z", "started_at": "2023-03-10T23:54:55.605Z", "ends_at": "2025-11-07T00:43:09.247Z", "ended_at": "2025-09-16T08:39:57.875Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": ""}}], "pagination": {"total_count": 656093, "max_page": 191255}} "422": application/json: {} customer_portal:orders:get: @@ -2479,7 +2560,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "tax_amount": 521235, "currency": "Rand", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2024-05-17T00:32:02.244Z", "modified_at": "2024-05-09T02:28:23.533Z", "id": "", "name": "", "description": "extract neaten qua meanwhile bah", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-08-19T11:11:04.610Z", "modified_at": "2024-07-25T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2024-04-25T04:53:50.189Z", "modified_at": "2025-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/include", "mime_type": "", "size": 908293, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-04-06T10:37:18.493Z", "version": "", "is_uploaded": false, "created_at": "2024-03-31T04:11:43.083Z", "size_readable": "", "public_url": "https://shy-knuckle.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 72108, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-03-31T04:26:02.125Z", "version": "", "is_uploaded": true, "created_at": "2024-12-12T10:59:52.193Z", "size_readable": "", "public_url": "https://writhing-airman.name"}], "organization": {"created_at": "2025-01-24T20:29:18.334Z", "modified_at": "2023-11-17T13:07:10.938Z", "id": "", "name": "", "slug": "", "avatar_url": "https://foolish-descendant.net", "bio": "", "company": "Schaefer - Sawayn", "blog": "", "location": "", "email": "Citlalli.Boehm@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 168726, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 546533, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2025-03-29T06:09:39.323Z", "modified_at": "2024-10-28T22:54:36.498Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 322612, "maximum_amount": 323185, "preset_amount": 177375}, "subscription": {"created_at": "2023-02-04T11:10:26.128Z", "modified_at": "2024-01-08T11:20:01.925Z", "id": "", "amount": 844917, "currency": "Moldovan Leu", "recurring_interval": "year", "status": "canceled", "current_period_start": "2024-01-20T11:46:53.929Z", "current_period_end": "2024-08-08T16:26:13.017Z", "cancel_at_period_end": false, "canceled_at": "2025-09-27T20:59:18.499Z", "started_at": "2023-08-28T17:52:37.706Z", "ends_at": "2024-08-08T00:55:49.489Z", "ended_at": "2023-03-22T21:11:05.801Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "tax_amount": 521235, "currency": "Rand", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2024-05-17T00:32:02.244Z", "modified_at": "2024-05-09T02:28:23.533Z", "id": "", "name": "", "description": "extract neaten qua meanwhile bah", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-08-19T11:11:04.610Z", "modified_at": "2024-07-25T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2024-04-25T04:53:50.189Z", "modified_at": "2025-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/include", "mime_type": "", "size": 908293, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-04-06T10:37:18.493Z", "version": "", "is_uploaded": false, "created_at": "2024-03-31T04:11:43.083Z", "size_readable": "", "public_url": "https://shy-knuckle.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 72108, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-03-31T04:26:02.125Z", "version": "", "is_uploaded": true, "created_at": "2024-12-12T10:59:52.193Z", "size_readable": "", "public_url": "https://writhing-airman.name"}], "organization": {"created_at": "2025-01-24T20:29:18.334Z", "modified_at": "2023-11-17T13:07:10.938Z", "id": "", "name": "", "slug": "", "avatar_url": "https://foolish-descendant.net", "bio": "", "company": "Schaefer - Sawayn", "blog": "", "location": "", "email": "Citlalli.Boehm@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 168726, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 546533, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2024-08-28T15:06:35.685Z", "modified_at": "2025-06-02T05:45:06.910Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 746585, "recurring_interval": "year"}, "subscription": {"created_at": "2023-02-04T11:10:26.128Z", "modified_at": "2024-01-08T11:20:01.925Z", "id": "", "amount": 844917, "currency": "Moldovan Leu", "recurring_interval": "year", "status": "canceled", "current_period_start": "2024-01-20T11:46:53.929Z", "current_period_end": "2024-08-08T16:26:13.017Z", "cancel_at_period_end": false, "canceled_at": "2025-09-27T20:59:18.499Z", "started_at": "2023-08-28T17:52:37.706Z", "ends_at": "2024-08-08T00:55:49.489Z", "ended_at": "2023-03-22T21:11:05.801Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}} "404": application/json: {"detail": ""} "422": @@ -2516,7 +2597,7 @@ examples: limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "amount": 177706, "currency": "Danish Krone", "recurring_interval": "month", "status": "past_due", "current_period_start": "2024-12-01T18:25:37.169Z", "current_period_end": "2023-01-20T06:21:22.156Z", "cancel_at_period_end": false, "canceled_at": "2023-04-05T09:49:38.010Z", "started_at": "2023-03-17T01:57:00.187Z", "ends_at": "2025-01-24T00:05:25.844Z", "ended_at": "2024-07-12T19:57:33.016Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-01-09T04:26:27.312Z", "modified_at": "2023-03-01T20:22:54.911Z", "id": "", "name": "", "description": "beautifully comparison now despite er", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-01-13T10:26:00.433Z", "modified_at": "2023-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, {"created_at": "2023-04-05T09:49:38.010Z", "modified_at": "2023-03-17T01:57:00.187Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2024-08-19T22:29:27.736Z", "modified_at": "2023-03-15T10:11:56.132Z", "id": "", "type": "custom", "description": "meanwhile synthesise angrily inasmuch irritably", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-09-14T09:33:23.636Z", "modified_at": "2023-02-25T05:24:29.459Z", "id": "", "type": "github_repository", "description": "gah only despite seemingly eventually ah", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2025-03-07T17:43:00.381Z", "modified_at": "2025-06-02T11:43:36.892Z", "id": "", "type": "license_keys", "description": "fork shampoo outnumber so hence heartache afford pish", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-01-01T09:29:03.176Z", "modified_at": "2024-04-27T12:09:29.137Z", "id": "", "name": "", "slug": "", "avatar_url": "https://fair-marketplace.org/", "bio": "", "company": "Cremin, VonRueden and Sporer", "blog": "", "location": "", "email": "Wayne62@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 877227, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 412854, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2023-03-22T06:10:55.267Z", "modified_at": "2025-10-17T13:20:28.265Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 876407, "maximum_amount": 490078, "preset_amount": 51681, "recurring_interval": "month"}}, {"created_at": "2025-03-07T02:26:31.358Z", "modified_at": "2023-06-21T02:05:32.746Z", "id": "", "amount": 783071, "currency": "New Israeli Sheqel", "recurring_interval": "year", "status": "active", "current_period_start": "2025-12-16T05:11:35.383Z", "current_period_end": "2024-06-30T19:00:16.624Z", "cancel_at_period_end": false, "canceled_at": "2025-05-27T06:03:00.110Z", "started_at": "2025-10-25T10:50:37.438Z", "ends_at": "2025-01-09T05:13:52.456Z", "ended_at": "2023-06-25T16:02:25.369Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-09-10T11:54:14.319Z", "modified_at": "2025-01-19T21:45:37.595Z", "id": "", "name": "", "description": "linseed finger inasmuch hydrolyze blowgun for and jaggedly aftermath after", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-09-22T23:25:46.808Z", "modified_at": "2025-12-12T02:25:00.484Z", "id": "", "type": "custom", "description": "boo but favorite beneath remand until graffiti gee afore", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/ppp", "mime_type": "", "size": 206196, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-03-23T18:37:18.822Z", "version": "", "is_uploaded": false, "created_at": "2024-05-31T11:35:53.906Z", "size_readable": "", "public_url": "https://troubled-sport.info/"}], "organization": {"created_at": "2025-03-15T19:32:30.408Z", "modified_at": "2025-01-26T04:32:33.599Z", "id": "", "name": "", "slug": "", "avatar_url": "https://definitive-valuable.net/", "bio": "", "company": "Orn, Kassulke and Wolf", "blog": "", "location": "", "email": "Trycia.Pollich@gmail.com", "twitter_username": "", "pledge_minimum_amount": 503527, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 893108, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "prorate"}}}, "price": {"created_at": "2023-07-09T16:58:41.012Z", "modified_at": "2023-03-24T06:20:14.879Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}}, {"created_at": "2023-08-06T19:06:11.414Z", "modified_at": "2023-02-21T11:53:00.306Z", "id": "", "amount": 311256, "currency": "Kina", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-08-12T15:15:51.578Z", "current_period_end": "2024-05-03T11:56:14.302Z", "cancel_at_period_end": true, "canceled_at": "2024-02-04T13:38:36.706Z", "started_at": "2025-10-17T11:33:15.679Z", "ends_at": "2024-01-06T04:46:06.802Z", "ended_at": "2023-11-25T19:49:39.802Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-04-05T07:02:58.119Z", "modified_at": "2023-11-03T23:20:28.461Z", "id": "", "name": "", "description": "incomparable knavishly between via", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-04-19T11:47:41.889Z", "modified_at": "2024-06-10T18:07:18.321Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 523875, "maximum_amount": 841031, "preset_amount": 410206, "recurring_interval": "year"}, {"created_at": "2023-05-05T09:08:16.530Z", "modified_at": "2023-07-18T12:08:53.113Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 33597, "maximum_amount": 628106, "preset_amount": 934960, "recurring_interval": "year"}, {"created_at": "2024-09-14T04:48:08.824Z", "modified_at": "2025-07-08T11:13:00.198Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2025-05-28T03:27:06.201Z", "modified_at": "2025-08-23T10:37:24.845Z", "id": "", "type": "license_keys", "description": "address loosely bathhouse nifty for second characterization", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-11-07T00:43:09.247Z", "modified_at": "2025-09-16T08:39:57.875Z", "id": "", "type": "github_repository", "description": "zowie crossly but unless blowgun zowie yahoo on", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-10-12T23:03:01.657Z", "modified_at": "2025-09-30T03:31:07.896Z", "id": "", "type": "ads", "description": "bench how oddly hm technician jaggedly scarcely honestly submitter", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home/user", "mime_type": "", "size": 11743, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-10-18T23:42:45.873Z", "version": "", "is_uploaded": true, "created_at": "2023-08-20T06:26:00.263Z", "size_readable": "", "public_url": "https://insignificant-underpants.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 605160, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-03T00:12:10.008Z", "version": "", "is_uploaded": true, "created_at": "2023-05-12T16:50:12.064Z", "size_readable": "", "public_url": "https://rural-draw.name"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/ppp", "mime_type": "", "size": 370500, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-01-30T06:06:22.392Z", "version": "", "is_uploaded": false, "created_at": "2023-08-05T13:07:41.645Z", "size_readable": "", "public_url": "https://burly-elevation.com/"}], "organization": {"created_at": "2023-04-11T04:01:33.016Z", "modified_at": "2023-08-31T01:24:41.834Z", "id": "", "name": "", "slug": "", "avatar_url": "https://understated-muscat.net/", "bio": "", "company": "Lemke - Huels", "blog": "", "location": "", "email": "Kayli_Langworth@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 929432, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 819205, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2023-06-05T08:58:03.644Z", "modified_at": "2024-12-28T19:56:44.465Z", "id": "", "is_archived": true, "product_id": ""}}], "pagination": {"total_count": 66208, "max_page": 687167}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "amount": 177706, "currency": "Danish Krone", "recurring_interval": "month", "status": "past_due", "current_period_start": "2024-12-01T18:25:37.169Z", "current_period_end": "2023-01-20T06:21:22.156Z", "cancel_at_period_end": false, "canceled_at": "2023-04-05T09:49:38.010Z", "started_at": "2023-03-17T01:57:00.187Z", "ends_at": "2025-01-24T00:05:25.844Z", "ended_at": "2024-07-12T19:57:33.016Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-01-09T04:26:27.312Z", "modified_at": "2023-03-01T20:22:54.911Z", "id": "", "name": "", "description": "beautifully comparison now despite er", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-01-13T10:26:00.433Z", "modified_at": "2023-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, {"created_at": "2023-04-05T09:49:38.010Z", "modified_at": "2023-03-17T01:57:00.187Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2024-08-19T22:29:27.736Z", "modified_at": "2023-03-15T10:11:56.132Z", "id": "", "type": "custom", "description": "meanwhile synthesise angrily inasmuch irritably", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-09-14T09:33:23.636Z", "modified_at": "2023-02-25T05:24:29.459Z", "id": "", "type": "github_repository", "description": "gah only despite seemingly eventually ah", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2025-03-07T17:43:00.381Z", "modified_at": "2025-06-02T11:43:36.892Z", "id": "", "type": "license_keys", "description": "fork shampoo outnumber so hence heartache afford pish", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-01-01T09:29:03.176Z", "modified_at": "2024-04-27T12:09:29.137Z", "id": "", "name": "", "slug": "", "avatar_url": "https://fair-marketplace.org/", "bio": "", "company": "Cremin, VonRueden and Sporer", "blog": "", "location": "", "email": "Wayne62@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 877227, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 412854, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2023-03-01T20:22:54.911Z", "modified_at": "2024-02-08T01:09:52.088Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 73227}}, {"created_at": "2025-03-07T02:26:31.358Z", "modified_at": "2023-06-21T02:05:32.746Z", "id": "", "amount": 783071, "currency": "New Israeli Sheqel", "recurring_interval": "year", "status": "active", "current_period_start": "2025-12-16T05:11:35.383Z", "current_period_end": "2024-06-30T19:00:16.624Z", "cancel_at_period_end": false, "canceled_at": "2025-05-27T06:03:00.110Z", "started_at": "2025-10-25T10:50:37.438Z", "ends_at": "2025-01-09T05:13:52.456Z", "ended_at": "2023-06-25T16:02:25.369Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-09-10T11:54:14.319Z", "modified_at": "2025-01-19T21:45:37.595Z", "id": "", "name": "", "description": "linseed finger inasmuch hydrolyze blowgun for and jaggedly aftermath after", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-09-22T23:25:46.808Z", "modified_at": "2025-12-12T02:25:00.484Z", "id": "", "type": "custom", "description": "boo but favorite beneath remand until graffiti gee afore", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/ppp", "mime_type": "", "size": 206196, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-03-23T18:37:18.822Z", "version": "", "is_uploaded": false, "created_at": "2024-05-31T11:35:53.906Z", "size_readable": "", "public_url": "https://troubled-sport.info/"}], "organization": {"created_at": "2025-03-15T19:32:30.408Z", "modified_at": "2025-01-26T04:32:33.599Z", "id": "", "name": "", "slug": "", "avatar_url": "https://definitive-valuable.net/", "bio": "", "company": "Orn, Kassulke and Wolf", "blog": "", "location": "", "email": "Trycia.Pollich@gmail.com", "twitter_username": "", "pledge_minimum_amount": 503527, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 893108, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "prorate"}}}, "price": {"created_at": "2025-08-18T13:00:42.665Z", "modified_at": "2024-06-21T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}}, {"created_at": "2023-08-06T19:06:11.414Z", "modified_at": "2023-02-21T11:53:00.306Z", "id": "", "amount": 311256, "currency": "Kina", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-08-12T15:15:51.578Z", "current_period_end": "2024-05-03T11:56:14.302Z", "cancel_at_period_end": true, "canceled_at": "2024-02-04T13:38:36.706Z", "started_at": "2025-10-17T11:33:15.679Z", "ends_at": "2024-01-06T04:46:06.802Z", "ended_at": "2023-11-25T19:49:39.802Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-04-05T07:02:58.119Z", "modified_at": "2023-11-03T23:20:28.461Z", "id": "", "name": "", "description": "incomparable knavishly between via", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-09-28T03:47:03.515Z", "modified_at": "2023-07-09T16:58:41.012Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 897069, "maximum_amount": 135572, "preset_amount": 460276}, {"created_at": "2024-06-10T18:07:18.321Z", "modified_at": "2023-04-24T08:24:21.019Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 841031, "maximum_amount": 410206, "preset_amount": 863466, "recurring_interval": "month"}, {"created_at": "2023-07-18T12:08:53.113Z", "modified_at": "2025-09-28T13:56:10.162Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 628106, "recurring_interval": "year"}], "benefits": [{"created_at": "2025-05-28T03:27:06.201Z", "modified_at": "2025-08-23T10:37:24.845Z", "id": "", "type": "license_keys", "description": "address loosely bathhouse nifty for second characterization", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-11-07T00:43:09.247Z", "modified_at": "2025-09-16T08:39:57.875Z", "id": "", "type": "github_repository", "description": "zowie crossly but unless blowgun zowie yahoo on", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-10-12T23:03:01.657Z", "modified_at": "2025-09-30T03:31:07.896Z", "id": "", "type": "ads", "description": "bench how oddly hm technician jaggedly scarcely honestly submitter", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home/user", "mime_type": "", "size": 11743, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-10-18T23:42:45.873Z", "version": "", "is_uploaded": true, "created_at": "2023-08-20T06:26:00.263Z", "size_readable": "", "public_url": "https://insignificant-underpants.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 605160, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-03T00:12:10.008Z", "version": "", "is_uploaded": true, "created_at": "2023-05-12T16:50:12.064Z", "size_readable": "", "public_url": "https://rural-draw.name"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/ppp", "mime_type": "", "size": 370500, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-01-30T06:06:22.392Z", "version": "", "is_uploaded": false, "created_at": "2023-08-05T13:07:41.645Z", "size_readable": "", "public_url": "https://burly-elevation.com/"}], "organization": {"created_at": "2023-04-11T04:01:33.016Z", "modified_at": "2023-08-31T01:24:41.834Z", "id": "", "name": "", "slug": "", "avatar_url": "https://understated-muscat.net/", "bio": "", "company": "Lemke - Huels", "blog": "", "location": "", "email": "Kayli_Langworth@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 929432, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 819205, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2025-01-29T10:30:11.361Z", "modified_at": "2024-09-14T04:48:08.824Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 816637}}], "pagination": {"total_count": 66208, "max_page": 687167}} "422": application/json: {} customer_portal:subscriptions:get: @@ -2526,7 +2607,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "active", "current_period_start": "2024-05-09T02:28:23.533Z", "current_period_end": "2023-10-16T00:34:27.106Z", "cancel_at_period_end": true, "canceled_at": "2025-10-24T02:41:21.259Z", "started_at": "2024-04-25T04:53:50.189Z", "ends_at": "2025-05-28T07:17:57.134Z", "ended_at": "2023-03-28T11:05:23.685Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-12-10T13:21:20.945Z", "modified_at": "2023-04-14T16:04:46.468Z", "id": "", "name": "", "description": "fellow scary but embarrassment metabolise last huddle", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-08-19T11:11:04.610Z", "modified_at": "2024-07-25T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2024-04-25T04:53:50.189Z", "modified_at": "2025-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2025-05-08T16:06:38.834Z", "modified_at": "2025-01-01T17:44:05.420Z", "id": "", "type": "ads", "description": "ugh manner minor obediently aw fibre", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-05-10T07:09:21.582Z", "modified_at": "2023-06-04T09:34:39.316Z", "id": "", "type": "github_repository", "description": "book knotty er beneath", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-04-02T04:37:19.052Z", "modified_at": "2023-01-09T14:26:53.626Z", "id": "", "type": "downloadables", "description": "like claw incidentally nor drat consequently", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 601522, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-27T07:41:12.642Z", "version": "", "is_uploaded": true, "created_at": "2023-08-23T12:46:20.079Z", "size_readable": "", "public_url": "https://front-chops.name"}], "organization": {"created_at": "2025-06-06T15:31:06.300Z", "modified_at": "2023-02-06T03:36:19.111Z", "id": "", "name": "", "slug": "", "avatar_url": "https://rotten-earth.name/", "bio": "", "company": "Larson - Lindgren", "blog": "", "location": "", "email": "Kathryn.Kerluke@gmail.com", "twitter_username": "", "pledge_minimum_amount": 95718, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 222075, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}}, "price": {"created_at": "2025-03-29T06:09:39.323Z", "modified_at": "2024-10-28T22:54:36.498Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 322612, "maximum_amount": 323185, "preset_amount": 177375}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "active", "current_period_start": "2024-05-09T02:28:23.533Z", "current_period_end": "2023-10-16T00:34:27.106Z", "cancel_at_period_end": true, "canceled_at": "2025-10-24T02:41:21.259Z", "started_at": "2024-04-25T04:53:50.189Z", "ends_at": "2025-05-28T07:17:57.134Z", "ended_at": "2023-03-28T11:05:23.685Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-12-10T13:21:20.945Z", "modified_at": "2023-04-14T16:04:46.468Z", "id": "", "name": "", "description": "fellow scary but embarrassment metabolise last huddle", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-08-19T11:11:04.610Z", "modified_at": "2024-07-25T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2024-04-25T04:53:50.189Z", "modified_at": "2025-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2025-05-08T16:06:38.834Z", "modified_at": "2025-01-01T17:44:05.420Z", "id": "", "type": "ads", "description": "ugh manner minor obediently aw fibre", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-05-10T07:09:21.582Z", "modified_at": "2023-06-04T09:34:39.316Z", "id": "", "type": "github_repository", "description": "book knotty er beneath", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-04-02T04:37:19.052Z", "modified_at": "2023-01-09T14:26:53.626Z", "id": "", "type": "downloadables", "description": "like claw incidentally nor drat consequently", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 601522, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-27T07:41:12.642Z", "version": "", "is_uploaded": true, "created_at": "2023-08-23T12:46:20.079Z", "size_readable": "", "public_url": "https://front-chops.name"}], "organization": {"created_at": "2025-06-06T15:31:06.300Z", "modified_at": "2023-02-06T03:36:19.111Z", "id": "", "name": "", "slug": "", "avatar_url": "https://rotten-earth.name/", "bio": "", "company": "Larson - Lindgren", "blog": "", "location": "", "email": "Kathryn.Kerluke@gmail.com", "twitter_username": "", "pledge_minimum_amount": 95718, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 222075, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}}, "price": {"created_at": "2024-08-28T15:06:35.685Z", "modified_at": "2025-06-02T05:45:06.910Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 746585, "recurring_interval": "year"}} "404": application/json: {"detail": ""} "422": @@ -2540,7 +2621,7 @@ examples: application/json: {} responses: "200": - application/json: {"created_at": "2024-10-16T10:52:42.015Z", "modified_at": "2024-01-13T16:52:57.274Z", "id": "", "amount": 991464, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-03-01T06:03:05.915Z", "current_period_end": "2025-09-09T13:32:29.600Z", "cancel_at_period_end": true, "canceled_at": "2023-12-08T09:52:54.805Z", "started_at": "2023-10-01T09:16:09.932Z", "ends_at": "2023-06-02T23:29:52.263Z", "ended_at": "2025-05-15T01:05:20.251Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-11-28T11:56:11.232Z", "modified_at": "2024-05-23T23:10:45.412Z", "id": "", "name": "", "description": "mostly rekindle bleak from that qualified cycle woot abseil", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-01-13T16:52:57.274Z", "modified_at": "2025-12-22T15:27:45.882Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 488852, "maximum_amount": 984008, "preset_amount": 54062}, {"created_at": "2023-12-08T09:52:54.805Z", "modified_at": "2023-10-01T09:16:09.932Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 789275, "maximum_amount": 889838, "preset_amount": 302461}], "benefits": [{"created_at": "2023-03-06T08:10:15.601Z", "modified_at": "2025-11-26T02:34:57.845Z", "id": "", "type": "ads", "description": "lightly ultimately in", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-05-31T06:05:34.308Z", "modified_at": "2025-10-28T09:59:31.522Z", "id": "", "name": "", "slug": "", "avatar_url": "https://joyous-supplier.com/", "bio": "", "company": "Cruickshank, Rosenbaum and Rice", "blog": "", "location": "", "email": "Boyd38@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 620905, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 643119, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "price": {"created_at": "2025-04-08T20:18:13.273Z", "modified_at": "2025-06-07T17:17:15.505Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 501135, "recurring_interval": "month"}} + application/json: {"created_at": "2024-10-16T10:52:42.015Z", "modified_at": "2024-01-13T16:52:57.274Z", "id": "", "amount": 991464, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-03-01T06:03:05.915Z", "current_period_end": "2025-09-09T13:32:29.600Z", "cancel_at_period_end": true, "canceled_at": "2023-12-08T09:52:54.805Z", "started_at": "2023-10-01T09:16:09.932Z", "ends_at": "2023-06-02T23:29:52.263Z", "ended_at": "2025-05-15T01:05:20.251Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-11-28T11:56:11.232Z", "modified_at": "2024-05-23T23:10:45.412Z", "id": "", "name": "", "description": "mostly rekindle bleak from that qualified cycle woot abseil", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-01-13T16:52:57.274Z", "modified_at": "2025-12-22T15:27:45.882Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 488852, "maximum_amount": 984008, "preset_amount": 54062}, {"created_at": "2023-12-08T09:52:54.805Z", "modified_at": "2023-10-01T09:16:09.932Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 789275, "maximum_amount": 889838, "preset_amount": 302461}], "benefits": [{"created_at": "2023-03-06T08:10:15.601Z", "modified_at": "2025-11-26T02:34:57.845Z", "id": "", "type": "ads", "description": "lightly ultimately in", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-05-31T06:05:34.308Z", "modified_at": "2025-10-28T09:59:31.522Z", "id": "", "name": "", "slug": "", "avatar_url": "https://joyous-supplier.com/", "bio": "", "company": "Cruickshank, Rosenbaum and Rice", "blog": "", "location": "", "email": "Boyd38@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 620905, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 643119, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "price": {"created_at": "2025-01-30T02:01:14.461Z", "modified_at": "2024-03-19T01:46:46.018Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}} "403": application/json: {"detail": ""} "404": @@ -2554,7 +2635,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2023-01-28T04:39:19.513Z", "modified_at": "2025-12-24T10:36:51.473Z", "id": "", "amount": 473916, "currency": "Bulgarian Lev", "recurring_interval": "month", "status": "trialing", "current_period_start": "2023-02-14T08:23:52.236Z", "current_period_end": "2023-06-28T03:41:26.855Z", "cancel_at_period_end": false, "canceled_at": "2023-06-09T14:11:56.790Z", "started_at": "2023-08-28T23:20:26.332Z", "ends_at": "2023-08-29T10:04:34.451Z", "ended_at": "2023-03-26T15:01:55.926Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-04-03T03:17:46.224Z", "modified_at": "2025-08-19T22:51:49.844Z", "id": "", "name": "", "description": "once likewise ecliptic along maintainer premise pfft retrospectivity", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-06-03T09:53:22.758Z", "modified_at": "2023-04-04T13:59:58.090Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, {"created_at": "2024-09-20T01:03:26.700Z", "modified_at": "2023-06-09T14:11:56.790Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 219361, "recurring_interval": "month"}, {"created_at": "2025-08-19T22:51:49.844Z", "modified_at": "2025-03-11T09:36:47.527Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 786521, "maximum_amount": 354376, "preset_amount": 439173}], "benefits": [{"created_at": "2025-01-15T21:10:47.290Z", "modified_at": "2025-12-18T18:35:19.693Z", "id": "", "type": "github_repository", "description": "enrich knuckle hence offensively out oh beneath round", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/libdata", "mime_type": "", "size": 693028, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-05T23:46:23.807Z", "version": "", "is_uploaded": false, "created_at": "2025-11-07T00:56:10.187Z", "size_readable": "", "public_url": "https://joyful-range.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/mail", "mime_type": "", "size": 9779, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-20T13:07:16.644Z", "version": "", "is_uploaded": false, "created_at": "2025-12-26T07:00:33.708Z", "size_readable": "", "public_url": "https://spanish-finger.biz"}], "organization": {"created_at": "2025-10-24T05:58:18.319Z", "modified_at": "2023-05-11T19:43:26.919Z", "id": "", "name": "", "slug": "", "avatar_url": "https://great-someplace.biz", "bio": "", "company": "Hammes, Cremin and Moen", "blog": "", "location": "", "email": "Francesca_Wuckert@gmail.com", "twitter_username": "", "pledge_minimum_amount": 890574, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 162000, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}}}, "price": {"created_at": "2025-03-05T02:29:28.045Z", "modified_at": "2023-11-13T19:32:56.650Z", "id": "", "is_archived": false, "product_id": ""}} + application/json: {"created_at": "2023-01-28T04:39:19.513Z", "modified_at": "2025-12-24T10:36:51.473Z", "id": "", "amount": 473916, "currency": "Bulgarian Lev", "recurring_interval": "month", "status": "trialing", "current_period_start": "2023-02-14T08:23:52.236Z", "current_period_end": "2023-06-28T03:41:26.855Z", "cancel_at_period_end": false, "canceled_at": "2023-06-09T14:11:56.790Z", "started_at": "2023-08-28T23:20:26.332Z", "ends_at": "2023-08-29T10:04:34.451Z", "ended_at": "2023-03-26T15:01:55.926Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-04-03T03:17:46.224Z", "modified_at": "2025-08-19T22:51:49.844Z", "id": "", "name": "", "description": "once likewise ecliptic along maintainer premise pfft retrospectivity", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-06-03T09:53:22.758Z", "modified_at": "2023-04-04T13:59:58.090Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, {"created_at": "2024-09-20T01:03:26.700Z", "modified_at": "2023-06-09T14:11:56.790Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 219361, "recurring_interval": "month"}, {"created_at": "2025-08-19T22:51:49.844Z", "modified_at": "2025-03-11T09:36:47.527Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 786521, "maximum_amount": 354376, "preset_amount": 439173}], "benefits": [{"created_at": "2025-01-15T21:10:47.290Z", "modified_at": "2025-12-18T18:35:19.693Z", "id": "", "type": "github_repository", "description": "enrich knuckle hence offensively out oh beneath round", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/libdata", "mime_type": "", "size": 693028, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-05T23:46:23.807Z", "version": "", "is_uploaded": false, "created_at": "2025-11-07T00:56:10.187Z", "size_readable": "", "public_url": "https://joyful-range.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/mail", "mime_type": "", "size": 9779, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-20T13:07:16.644Z", "version": "", "is_uploaded": false, "created_at": "2025-12-26T07:00:33.708Z", "size_readable": "", "public_url": "https://spanish-finger.biz"}], "organization": {"created_at": "2025-10-24T05:58:18.319Z", "modified_at": "2023-05-11T19:43:26.919Z", "id": "", "name": "", "slug": "", "avatar_url": "https://great-someplace.biz", "bio": "", "company": "Hammes, Cremin and Moen", "blog": "", "location": "", "email": "Francesca_Wuckert@gmail.com", "twitter_username": "", "pledge_minimum_amount": 890574, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 162000, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}}}, "price": {"created_at": "2024-06-24T17:34:35.287Z", "modified_at": "2025-10-12T12:34:44.204Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}} "403": application/json: {"detail": ""} "404": @@ -2577,7 +2658,116 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "active", "current_period_start": "2024-05-09T02:28:23.533Z", "current_period_end": "2023-10-16T00:34:27.106Z", "cancel_at_period_end": true, "canceled_at": "2025-10-24T02:41:21.259Z", "started_at": "2024-04-25T04:53:50.189Z", "ends_at": "2025-05-28T07:17:57.134Z", "ended_at": "2023-03-28T11:05:23.685Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "metadata": {"key": ""}, "customer": {"created_at": "2024-08-28T15:06:35.685Z", "modified_at": "2025-06-02T05:45:06.910Z", "id": "", "metadata": {"key": false}, "email": "Enid.Dare78@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Samoa"}, "tax_id": ["ec_ruc", ""], "organization_id": "", "avatar_url": "https://jumbo-hippodrome.com"}, "user_id": "", "user": {"id": "", "email": "Kathryn_Stoltenberg53@gmail.com", "public_name": ""}, "product": {"created_at": "2025-03-10T04:17:15.995Z", "modified_at": "2025-04-19T12:48:05.172Z", "id": "", "name": "", "description": "notwithstanding harangue once out effector determined", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": true}, "prices": [], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/boot", "mime_type": "", "size": 491026, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-11-26T02:36:46.301Z", "version": "", "is_uploaded": false, "created_at": "2023-03-21T02:59:14.977Z", "size_readable": "", "public_url": "https://neglected-scholarship.org"}, {"id": "", "organization_id": "", "name": "", "path": "/bin", "mime_type": "", "size": 339847, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-07-15T00:41:32.877Z", "version": "", "is_uploaded": false, "created_at": "2024-09-24T06:33:56.610Z", "size_readable": "", "public_url": "https://gummy-louse.org"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-08-08T00:55:49.489Z", "modified_at": "2023-03-22T21:11:05.801Z", "id": "", "metadata": {"key": 716267, "key1": "", "key2": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 554334, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-03-02T09:16:28.575Z", "modified_at": "2024-09-25T20:07:17.479Z", "id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 140875, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-03-08T18:10:54.489Z", "modified_at": "2024-08-07T22:42:08.632Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 430812, "required": true}]}, "price": {"created_at": "2023-03-30T11:50:33.761Z", "modified_at": "2024-02-03T08:18:51.900Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 530112, "maximum_amount": 813525, "preset_amount": 491282, "recurring_interval": "year"}, "discount": {"duration": "forever", "duration_in_months": 960234, "type": "fixed", "amount": 96389, "currency": "Lebanese Pound", "created_at": "2024-11-09T06:42:52.951Z", "modified_at": "2025-09-27T18:33:49.065Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2024-02-20T01:25:38.973Z", "ends_at": "2023-09-29T18:18:20.911Z", "max_redemptions": 783566, "redemptions_count": 163922, "organization_id": ""}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "active", "current_period_start": "2024-05-09T02:28:23.533Z", "current_period_end": "2023-10-16T00:34:27.106Z", "cancel_at_period_end": true, "canceled_at": "2025-10-24T02:41:21.259Z", "started_at": "2024-04-25T04:53:50.189Z", "ends_at": "2025-05-28T07:17:57.134Z", "ended_at": "2023-03-28T11:05:23.685Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "metadata": {"key": ""}, "customer": {"created_at": "2024-08-28T15:06:35.685Z", "modified_at": "2025-06-02T05:45:06.910Z", "id": "", "metadata": {"key": false}, "email": "Enid.Dare78@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Samoa"}, "tax_id": ["ec_ruc", ""], "organization_id": "", "avatar_url": "https://jumbo-hippodrome.com"}, "user_id": "", "user": {"id": "", "email": "Kathryn_Stoltenberg53@gmail.com", "public_name": ""}, "product": {"created_at": "2025-03-10T04:17:15.995Z", "modified_at": "2025-04-19T12:48:05.172Z", "id": "", "name": "", "description": "notwithstanding harangue once out effector determined", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": true}, "prices": [], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/boot", "mime_type": "", "size": 491026, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-11-26T02:36:46.301Z", "version": "", "is_uploaded": false, "created_at": "2023-03-21T02:59:14.977Z", "size_readable": "", "public_url": "https://neglected-scholarship.org"}, {"id": "", "organization_id": "", "name": "", "path": "/bin", "mime_type": "", "size": 339847, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-07-15T00:41:32.877Z", "version": "", "is_uploaded": false, "created_at": "2024-09-24T06:33:56.610Z", "size_readable": "", "public_url": "https://gummy-louse.org"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-07-25T06:33:15.810Z", "modified_at": "2025-11-29T01:50:48.954Z", "id": "", "metadata": {"key": 262795}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 554334, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2025-10-24T02:41:21.259Z", "modified_at": "2024-04-25T04:53:50.189Z", "id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 140875, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-08-28T15:06:35.685Z", "modified_at": "2025-06-02T05:45:06.910Z", "id": "", "metadata": {"key": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 430812, "required": true}]}, "price": {"created_at": "2023-12-20T13:59:56.783Z", "modified_at": "2023-12-21T05:04:07.004Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 243354, "maximum_amount": 780262, "preset_amount": 284041, "recurring_interval": "year"}, "discount": {"duration": "forever", "duration_in_months": 960234, "type": "fixed", "amount": 96389, "currency": "Lebanese Pound", "created_at": "2024-11-09T06:42:52.951Z", "modified_at": "2025-09-27T18:33:49.065Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2024-02-20T01:25:38.973Z", "ends_at": "2023-09-29T18:18:20.911Z", "max_redemptions": 783566, "redemptions_count": 163922, "organization_id": ""}} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + events:list: + speakeasy-default-events:list: + parameters: + query: + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [{"metadata": {"key": true, "key1": ""}, "id": "", "timestamp": "2023-06-17T12:14:27.999Z", "name": "", "source": "user", "organization_id": "", "customer_id": "", "external_customer_id": ""}, {"metadata": {"key": "", "key1": true}, "id": "", "timestamp": "2023-03-17T01:57:00.187Z", "name": "", "source": "user", "organization_id": "", "customer_id": "", "external_customer_id": ""}, {"metadata": {"key": 7468, "key1": ""}, "id": "", "timestamp": "2024-02-08T01:09:52.088Z", "name": "", "source": "system", "organization_id": "", "customer_id": "", "external_customer_id": ""}], "pagination": {"total_count": 73227, "max_page": 931165}} + "422": + application/json: {} + events:get: + speakeasy-default-events:get: + parameters: + path: + id: "" + responses: + "200": + application/json: {"metadata": {"key": 544221, "key1": 969961}, "id": "", "timestamp": "2024-05-17T00:32:02.244Z", "name": "", "source": "system", "organization_id": "", "customer_id": "", "external_customer_id": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + events:ingest: + speakeasy-default-events:ingest: + requestBody: + application/json: {"events": [{"name": "", "customer_id": ""}, {"name": "", "external_customer_id": ""}]} + responses: + "200": + application/json: {"inserted": 207692} + "422": + application/json: {} + meters:list: + speakeasy-default-meters:list: + parameters: + query: + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [{"metadata": {"key": true, "key1": ""}, "created_at": "2023-06-17T12:14:27.999Z", "modified_at": "2024-11-27T13:02:27.296Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": []}, "aggregation": {"func": "sum", "property": ""}, "organization_id": ""}, {"metadata": {}, "created_at": "2025-01-24T00:05:25.844Z", "modified_at": "2024-07-12T19:57:33.016Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": []}, "aggregation": {"func": "max", "property": ""}, "organization_id": ""}, {"metadata": {"key": ""}, "created_at": "2025-10-17T13:20:28.265Z", "modified_at": "2024-09-13T22:04:07.138Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": [{"property": "", "operator": "gt", "value": true}]}, "aggregation": {"func": "max", "property": ""}, "organization_id": ""}], "pagination": {"total_count": 913465, "max_page": 173090}} + "422": + application/json: {} + meters:create: + speakeasy-default-meters:create: + requestBody: + application/json: {"name": "", "filter": {"conjunction": "and", "clauses": [{"property": "", "operator": "ne", "value": ""}]}, "aggregation": {"func": "sum", "property": ""}} + responses: + "201": + application/json: {"metadata": {}, "created_at": "2023-04-09T14:25:29.356Z", "modified_at": "2025-05-18T17:03:53.906Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": []}, "aggregation": {}, "organization_id": ""} + "422": + application/json: {} + meters:get: + speakeasy-default-meters:get: + parameters: + path: + id: "" + responses: + "200": + application/json: {"metadata": {"key": 544221, "key1": 969961}, "created_at": "2024-05-17T00:32:02.244Z", "modified_at": "2024-05-09T02:28:23.533Z", "id": "", "name": "", "filter": {"conjunction": "and", "clauses": []}, "aggregation": {"func": "max", "property": ""}, "organization_id": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + meters:update: + speakeasy-default-meters:update: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"metadata": {"key": 344620, "key1": false, "key2": 984008}, "created_at": "2023-03-01T06:03:05.915Z", "modified_at": "2025-09-09T13:32:29.600Z", "id": "", "name": "", "filter": {"conjunction": "and", "clauses": [{"property": "", "operator": "ne", "value": false}]}, "aggregation": {}, "organization_id": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + meters:events: + speakeasy-default-meters:events: + parameters: + path: + id: "" + query: + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [], "pagination": {"total_count": 954664, "max_page": 537484}} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + meters:quantities: + speakeasy-default-meters:quantities: + parameters: + path: + id: "" + query: + start_timestamp: "2023-09-17T00:45:34.608Z" + end_timestamp: "2023-07-21T18:11:39.069Z" + interval: "hour" + responses: + "200": + application/json: {"quantities": [{"timestamp": "2023-10-29T11:55:31.312Z", "quantity": 1435.91}]} "404": application/json: {"detail": ""} "422": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index aa0a93ff..30b4634f 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,7 +16,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false python: - version: 0.13.4 + version: 0.13.5 additionalDependencies: dev: pytest: ^8.3.3 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 3c08e644..e9f607d0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.477.2 +speakeasyVersion: 1.484.1 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:cb46bd66fff57497f380c41134109643ebabe2a40e631e4871139b3c6e12beb5 - sourceBlobDigest: sha256:af17895c9591a019fcc82332db823c59ef4d18ba276fff2ff3a718d6739e383f + sourceRevisionDigest: sha256:7136504d86a1b1336da0fd04bb57797d52fa31c017848e7a060656930dc834f0 + sourceBlobDigest: sha256:65979b2ca8b35454357ff88e58d12c23708f6ea4dd5b22474799c45c2d9856aa tags: - latest - - speakeasy-sdk-regen-1738109507 + - speakeasy-sdk-regen-1738282328 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:cb46bd66fff57497f380c41134109643ebabe2a40e631e4871139b3c6e12beb5 - sourceBlobDigest: sha256:af17895c9591a019fcc82332db823c59ef4d18ba276fff2ff3a718d6739e383f + sourceRevisionDigest: sha256:7136504d86a1b1336da0fd04bb57797d52fa31c017848e7a060656930dc834f0 + sourceBlobDigest: sha256:65979b2ca8b35454357ff88e58d12c23708f6ea4dd5b22474799c45c2d9856aa codeSamplesNamespace: polar-oas-py-code-samples - codeSamplesRevisionDigest: sha256:0e8e487ec36c793999172a2d97103a02ab2d0e73700ef2da78ab1e84a1d6226a + codeSamplesRevisionDigest: sha256:02fd7d0f21cd8ec4f3998c4c18cd0fe5d9448f2e5c2d7a94623ede2cf0740590 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 3a318aa2..3d9cddc5 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,37 @@ pip install polar-sdk ```bash poetry add polar-sdk ``` + +### 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 polar-sdk 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 = [ +# "polar-sdk", +# ] +# /// + +from polar_sdk import Polar + +sdk = Polar( + # 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. @@ -603,6 +634,12 @@ def webhook(): * [update](docs/sdks/discounts/README.md#update) - Update Discount * [delete](docs/sdks/discounts/README.md#delete) - Delete Discount +### [events](docs/sdks/events/README.md) + +* [list](docs/sdks/events/README.md#list) - List Events +* [get](docs/sdks/events/README.md#get) - Get Event +* [ingest](docs/sdks/events/README.md#ingest) - Ingest Events + ### [external_organizations](docs/sdks/externalorganizations/README.md) * [list](docs/sdks/externalorganizations/README.md#list) - List External Organizations @@ -622,6 +659,15 @@ def webhook(): * [update](docs/sdks/licensekeys/README.md#update) - Update License Key * [get_activation](docs/sdks/licensekeys/README.md#get_activation) - Get Activation +### [meters](docs/sdks/meters/README.md) + +* [list](docs/sdks/meters/README.md#list) - List Meters +* [create](docs/sdks/meters/README.md#create) - Create Meter +* [get](docs/sdks/meters/README.md#get) - Get Meter +* [update](docs/sdks/meters/README.md#update) - Update Meter +* [events](docs/sdks/meters/README.md#events) - Get Meter Events +* [quantities](docs/sdks/meters/README.md#quantities) - Get Meter Quantities + ### [metrics](docs/sdks/metricssdk/README.md) * [get](docs/sdks/metricssdk/README.md#get) - Get Metrics @@ -701,7 +747,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10, + res = polar.external_organizations.list(, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) while res is not None: @@ -721,7 +767,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items @@ -763,7 +809,7 @@ with Polar( res = None try: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items @@ -801,7 +847,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items @@ -821,7 +867,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items @@ -931,7 +977,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items @@ -996,7 +1042,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items diff --git a/RELEASES.md b/RELEASES.md index ba92d856..2858d8ed 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -493,4 +493,14 @@ Based on: ### Generated - [python v0.13.4] . ### Releases -- [PyPI v0.13.4] https://pypi.org/project/polar-sdk/0.13.4 - . \ No newline at end of file +- [PyPI v0.13.4] https://pypi.org/project/polar-sdk/0.13.4 - . + +## 2025-02-05 14:24:15 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.484.1 (2.503.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.13.5] . +### Releases +- [PyPI v0.13.5] https://pypi.org/project/polar-sdk/0.13.5 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index a56f7a90..7621b0d1 100644 --- a/USAGE.md +++ b/USAGE.md @@ -7,7 +7,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items @@ -28,7 +28,7 @@ async def main(): access_token="", ) as polar: - res = await polar.external_organizations.list_async(page=1, limit=10) + res = await polar.external_organizations.list_async() while res is not None: # Handle items diff --git a/codeSamples.yaml b/codeSamples.yaml index 0c3cb637..304e0a89 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -8,7 +8,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.advertisements.list(benefit_id=\"\", page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.advertisements.list(benefit_id=\"\")\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/advertisements/{id}"]["get"] update: "x-codeSamples": @@ -20,7 +20,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.benefits.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.benefits.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/benefits/"]["post"] update: "x-codeSamples": @@ -50,19 +50,19 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.benefits.grants(id=\"\", page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.benefits.grants(id=\"\")\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/checkout-links/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkout_links.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkout_links.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/checkout-links/"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkout_links.create(request={\n \"payment_processor\": \"stripe\",\n \"product_id\": \"\",\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkout_links.create(request={\n \"payment_processor\": \"stripe\",\n \"allow_discount_codes\": True,\n \"product_id\": \"\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/checkout-links/{id}"]["delete"] update: "x-codeSamples": @@ -86,7 +86,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkouts.custom.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.checkouts.custom.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/checkouts/custom/"]["post"] update: "x-codeSamples": @@ -128,7 +128,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.custom_fields.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.custom_fields.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/custom-fields/"]["post"] update: "x-codeSamples": @@ -158,7 +158,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.benefit_grants.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.benefit_grants.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/customer-portal/benefit-grants/{id}"]["get"] update: "x-codeSamples": @@ -182,7 +182,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.downloadables.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.downloadables.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/customer-portal/downloadables/{token}"]["get"] update: "x-codeSamples": @@ -194,7 +194,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.license_keys.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.license_keys.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/customer-portal/license-keys/activate"]["post"] update: "x-codeSamples": @@ -224,7 +224,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.orders.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.orders.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/customer-portal/orders/{id}"]["get"] update: "x-codeSamples": @@ -248,7 +248,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.subscriptions.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.subscriptions.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/customer-portal/subscriptions/{id}"]["delete"] update: "x-codeSamples": @@ -278,7 +278,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customers.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/customers/"]["post"] update: "x-codeSamples": @@ -308,7 +308,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.discounts.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.discounts.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/discounts/"]["post"] update: "x-codeSamples": @@ -332,19 +332,37 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.discounts.update(id=\"\", discount_update={\n \"currency\": \"usd\",\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.discounts.update(id=\"\", discount_update={})\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/events/"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.events.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" + - target: $["paths"]["/v1/events/ingest"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.events.ingest(request={\n \"events\": [\n {\n \"name\": \"\",\n \"customer_id\": \"\",\n },\n {\n \"name\": \"\",\n \"external_customer_id\": \"\",\n },\n ],\n })\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/events/{id}"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.events.get(id=\"\")\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/external_organizations/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.external_organizations.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.external_organizations.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/files/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.files.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.files.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/files/"]["post"] update: "x-codeSamples": @@ -374,7 +392,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.license_keys.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.license_keys.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/license-keys/{id}"]["get"] update: "x-codeSamples": @@ -386,19 +404,55 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.license_keys.update(id=\"\", license_key_update={\n \"usage\": 0,\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.license_keys.update(id=\"\", license_key_update={})\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/license-keys/{id}/activations/{activation_id}"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.license_keys.get_activation(id=\"\", activation_id=\"\")\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/meters/"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" + - target: $["paths"]["/v1/meters/"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.create(request={\n \"name\": \"\",\n \"filter_\": {\n \"conjunction\": polar_sdk.FilterConjunction.AND,\n \"clauses\": [\n\n ],\n },\n \"aggregation\": {\n \"func\": polar_sdk.Func.SUM,\n \"property\": \"\",\n },\n })\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/meters/{id}"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.get(id=\"\")\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/meters/{id}"]["patch"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.update(id=\"\", meter_update={})\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/meters/{id}/events"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.events(id=\"\")\n\n while res is not None:\n # Handle items\n\n res = res.next()" + - target: $["paths"]["/v1/meters/{id}/quantities"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "Python (SDK)" + "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.meters.quantities(id=\"\", start_timestamp=dateutil.parser.isoparse(\"2023-09-17T00:45:34.608Z\"), end_timestamp=dateutil.parser.isoparse(\"2023-07-21T18:11:39.069Z\"), interval=polar_sdk.TimeInterval.HOUR)\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/metrics/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.metrics.get(start_date=dateutil.parser.parse(\"2025-02-06\").date(), end_date=dateutil.parser.parse(\"2024-09-04\").date(), interval=polar_sdk.Interval.WEEK)\n\n # Handle response\n print(res)" + "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.metrics.get(start_date=dateutil.parser.parse(\"2025-02-06\").date(), end_date=dateutil.parser.parse(\"2024-09-04\").date(), interval=polar_sdk.TimeInterval.WEEK)\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/metrics/limits"]["get"] update: "x-codeSamples": @@ -410,7 +464,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.oauth2.clients.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.oauth2.clients.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/oauth2/authorize"]["get"] update: "x-codeSamples": @@ -428,7 +482,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.oauth2.clients.create(request={\n \"redirect_uris\": [\n \"https://inferior-chainstay.com\",\n ],\n \"token_endpoint_auth_method\": polar_sdk.OAuth2ClientConfigurationTokenEndpointAuthMethod.CLIENT_SECRET_POST,\n \"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 products:read products:write benefits:read benefits:write events:read events:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write 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\",\n \"client_name\": \"\",\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.oauth2.clients.create(request={\n \"redirect_uris\": [\n \"https://inferior-chainstay.com\",\n ],\n \"client_name\": \"\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/oauth2/register/{client_id}"]["delete"] update: "x-codeSamples": @@ -446,7 +500,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.oauth2.clients.update(client_id=\"\", o_auth2_client_configuration_update={\n \"redirect_uris\": [\n \"https://grown-worth.name\",\n \"https://worthwhile-avalanche.org/\",\n \"https://general-digit.com/\",\n ],\n \"token_endpoint_auth_method\": polar_sdk.OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod.CLIENT_SECRET_POST,\n \"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 products:read products:write benefits:read benefits:write events:read events:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write 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\",\n \"client_name\": \"\",\n \"client_id\": \"\",\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.oauth2.clients.update(client_id=\"\", o_auth2_client_configuration_update={\n \"redirect_uris\": [\n \"https://grown-worth.name\",\n \"https://worthwhile-avalanche.org/\",\n \"https://general-digit.com/\",\n ],\n \"client_name\": \"\",\n \"client_id\": \"\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/oauth2/revoke"]["post"] update: "x-codeSamples": @@ -470,7 +524,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.orders.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/orders/{id}"]["get"] update: "x-codeSamples": @@ -488,7 +542,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.organizations.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.organizations.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/organizations/"]["post"] update: "x-codeSamples": @@ -506,13 +560,13 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.organizations.update(id=\"\", organization_update={\n \"pledge_badge_show_amount\": False,\n \"pledge_minimum_amount\": 2000,\n })\n\n # Handle response\n print(res)" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.organizations.update(id=\"\", organization_update={})\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/products/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.products.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.products.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/products/"]["post"] update: "x-codeSamples": @@ -542,19 +596,19 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.refunds.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.refunds.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/refunds/"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.refunds.create(request={\n \"order_id\": \"\",\n \"reason\": polar_sdk.RefundReason.CUSTOMER_REQUEST,\n \"amount\": 638424,\n \"revoke_benefits\": False,\n })\n\n assert res is not None\n\n # Handle response\n print(res)" + "source": "import polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.refunds.create(request={\n \"order_id\": \"\",\n \"reason\": polar_sdk.RefundReason.CUSTOMER_REQUEST,\n \"amount\": 638424,\n })\n\n assert res is not None\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/repositories/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.repositories.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.repositories.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/repositories/{id}"]["get"] update: "x-codeSamples": @@ -572,7 +626,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.subscriptions.list(page=1, limit=10)\n\n while res is not None:\n # Handle items\n\n res = res.next()" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.subscriptions.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" - target: $["paths"]["/v1/subscriptions/export"]["get"] update: "x-codeSamples": @@ -656,19 +710,19 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointorganization_updated_post(request={\n \"type\": \"organization.updated\",\n \"data\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-12T18:45:04.236Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-29T16:35:25.119Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"slug\": \"\",\n \"avatar_url\": \"https://devoted-bump.net\",\n \"bio\": \"\",\n \"company\": \"Torp, Kuhlman and Howell\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Dock_Friesen57@yahoo.com\",\n \"twitter_username\": \"\",\n \"pledge_minimum_amount\": 105265,\n \"pledge_badge_show_amount\": True,\n \"default_upfront_split_to_contributors\": 907160,\n \"profile_settings\": {},\n \"feature_settings\": {\n \"issue_funding_enabled\": False,\n },\n \"subscription_settings\": {\n \"allow_multiple_subscriptions\": False,\n \"allow_customer_updates\": True,\n \"proration_behavior\": polar_sdk.SubscriptionProrationBehavior.PRORATE,\n },\n },\n })\n\n # Handle response\n print(res)" + "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointorganization_updated_post(request={\n \"type\": \"organization.updated\",\n \"data\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-12T18:45:04.236Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-29T16:35:25.119Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"slug\": \"\",\n \"avatar_url\": \"https://devoted-bump.net\",\n \"bio\": \"\",\n \"company\": \"Torp, Kuhlman and Howell\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Dock_Friesen57@yahoo.com\",\n \"twitter_username\": \"\",\n \"pledge_minimum_amount\": 105265,\n \"pledge_badge_show_amount\": True,\n \"default_upfront_split_to_contributors\": 907160,\n \"profile_settings\": {},\n \"feature_settings\": {},\n \"subscription_settings\": {\n \"allow_multiple_subscriptions\": False,\n \"allow_customer_updates\": True,\n \"proration_behavior\": polar_sdk.SubscriptionProrationBehavior.PRORATE,\n },\n },\n })\n\n # Handle response\n print(res)" - target: $["paths"]["pledge.created"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointpledge_created_post(request=polar_sdk.WebhookPledgeCreatedPayload(\n type=\"pledge.created\",\n data=polar_sdk.Pledge(\n created_at=dateutil.parser.isoparse(\"2025-03-12T00:19:41.487Z\"),\n modified_at=dateutil.parser.isoparse(\"2023-04-19T01:42:59.169Z\"),\n id=\"\",\n amount=330877,\n currency=\"Jamaican Dollar\",\n state=polar_sdk.PledgeState.DISPUTED,\n type=polar_sdk.PledgeType.PAY_DIRECTLY,\n issue=polar_sdk.Issue(\n id=\"66524b69-aa0b-47ac-bb9a-0cee5d3a9110\",\n platform=polar_sdk.Platforms.GITHUB,\n number=280857,\n title=\"\",\n state=polar_sdk.State.OPEN,\n issue_created_at=dateutil.parser.isoparse(\"2024-02-26T00:33:35.289Z\"),\n needs_confirmation_solved=False,\n funding=polar_sdk.Funding(),\n repository=polar_sdk.Repository(\n id=\"356e14cb-87a4-484c-bcfa-ebfe50487706\",\n platform=polar_sdk.Platforms.GITHUB,\n is_private=True,\n name=\"MyOrg\",\n description=\"different premium tinderbox peter under often buzzing hastily\",\n stars=1337,\n license=\"\",\n homepage=\"\",\n profile_settings={},\n organization={\n \"id\": \"29159f56-74c0-464d-b598-8d5bc3b9cdda\",\n \"platform\": polar_sdk.Platforms.GITHUB,\n \"name\": \"\",\n \"avatar_url\": \"https://frightened-poppy.com/\",\n \"is_personal\": False,\n \"bio\": \"\",\n \"pretty_name\": \"\",\n \"company\": \"Bailey - Towne\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Cortez_Stehr70@yahoo.com\",\n \"twitter_username\": \"\",\n \"organization_id\": \"\",\n },\n internal_organization={\n \"created_at\": dateutil.parser.isoparse(\"2025-01-03T15:27:13.109Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-15T22:10:17.041Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"slug\": \"\",\n \"avatar_url\": \"https://hard-to-find-thyme.org\",\n \"bio\": \"\",\n \"company\": \"Schinner - Wiegand\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Pearline_Brekke@hotmail.com\",\n \"twitter_username\": \"\",\n \"pledge_minimum_amount\": 273260,\n \"pledge_badge_show_amount\": False,\n \"default_upfront_split_to_contributors\": 976949,\n \"profile_settings\": {},\n \"feature_settings\": {\n \"issue_funding_enabled\": False,\n },\n \"subscription_settings\": {\n \"allow_multiple_subscriptions\": True,\n \"allow_customer_updates\": True,\n \"proration_behavior\": polar_sdk.SubscriptionProrationBehavior.INVOICE,\n },\n },\n ),\n pledge_badge_currently_embedded=False,\n ),\n authed_can_admin_sender=False,\n authed_can_admin_received=False,\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointpledge_created_post(request=polar_sdk.WebhookPledgeCreatedPayload(\n type=\"pledge.created\",\n data=polar_sdk.Pledge(\n created_at=dateutil.parser.isoparse(\"2025-03-12T00:19:41.487Z\"),\n modified_at=dateutil.parser.isoparse(\"2023-04-19T01:42:59.169Z\"),\n id=\"\",\n amount=330877,\n currency=\"Jamaican Dollar\",\n state=polar_sdk.PledgeState.DISPUTED,\n type=polar_sdk.PledgeType.PAY_DIRECTLY,\n issue=polar_sdk.Issue(\n id=\"66524b69-aa0b-47ac-bb9a-0cee5d3a9110\",\n platform=polar_sdk.Platforms.GITHUB,\n number=280857,\n title=\"\",\n state=polar_sdk.State.OPEN,\n issue_created_at=dateutil.parser.isoparse(\"2024-02-26T00:33:35.289Z\"),\n needs_confirmation_solved=False,\n funding=polar_sdk.Funding(),\n repository=polar_sdk.Repository(\n id=\"356e14cb-87a4-484c-bcfa-ebfe50487706\",\n platform=polar_sdk.Platforms.GITHUB,\n is_private=True,\n name=\"MyOrg\",\n description=\"different premium tinderbox peter under often buzzing hastily\",\n stars=1337,\n license=\"\",\n homepage=\"\",\n profile_settings={},\n organization={\n \"id\": \"29159f56-74c0-464d-b598-8d5bc3b9cdda\",\n \"platform\": polar_sdk.Platforms.GITHUB,\n \"name\": \"\",\n \"avatar_url\": \"https://frightened-poppy.com/\",\n \"is_personal\": False,\n \"bio\": \"\",\n \"pretty_name\": \"\",\n \"company\": \"Bailey - Towne\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Cortez_Stehr70@yahoo.com\",\n \"twitter_username\": \"\",\n \"organization_id\": \"\",\n },\n internal_organization={\n \"created_at\": dateutil.parser.isoparse(\"2025-01-03T15:27:13.109Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-15T22:10:17.041Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"slug\": \"\",\n \"avatar_url\": \"https://hard-to-find-thyme.org\",\n \"bio\": \"\",\n \"company\": \"Schinner - Wiegand\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Pearline_Brekke@hotmail.com\",\n \"twitter_username\": \"\",\n \"pledge_minimum_amount\": 273260,\n \"pledge_badge_show_amount\": False,\n \"default_upfront_split_to_contributors\": 976949,\n \"profile_settings\": {},\n \"feature_settings\": {},\n \"subscription_settings\": {\n \"allow_multiple_subscriptions\": True,\n \"allow_customer_updates\": True,\n \"proration_behavior\": polar_sdk.SubscriptionProrationBehavior.INVOICE,\n },\n },\n ),\n pledge_badge_currently_embedded=False,\n ),\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["pledge.updated"]["post"] update: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointpledge_updated_post(request=polar_sdk.WebhookPledgeUpdatedPayload(\n type=\"pledge.updated\",\n data=polar_sdk.Pledge(\n created_at=dateutil.parser.isoparse(\"2024-11-29T00:10:39.674Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-10-02T21:42:49.754Z\"),\n id=\"\",\n amount=634567,\n currency=\"Singapore Dollar\",\n state=polar_sdk.PledgeState.REFUNDED,\n type=polar_sdk.PledgeType.PAY_ON_COMPLETION,\n issue=polar_sdk.Issue(\n id=\"d2e1349d-085a-441c-abf4-379a1f21d0da\",\n platform=polar_sdk.Platforms.GITHUB,\n number=218372,\n title=\"\",\n state=polar_sdk.State.CLOSED,\n issue_created_at=dateutil.parser.isoparse(\"2024-08-12T14:08:31.083Z\"),\n needs_confirmation_solved=True,\n funding=polar_sdk.Funding(),\n repository=polar_sdk.Repository(\n id=\"814bd7c6-3412-4f11-b523-7b38c659f44a\",\n platform=polar_sdk.Platforms.GITHUB,\n is_private=False,\n name=\"MyOrg\",\n description=\"hm however microchip\",\n stars=1337,\n license=\"\",\n homepage=\"\",\n profile_settings={},\n organization={\n \"id\": \"3ddd5cc2-de10-41ef-baa1-7551cf671cc3\",\n \"platform\": polar_sdk.Platforms.GITHUB,\n \"name\": \"\",\n \"avatar_url\": \"https://gummy-interviewer.biz\",\n \"is_personal\": False,\n \"bio\": \"\",\n \"pretty_name\": \"\",\n \"company\": \"Ferry - Tremblay\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Reggie_Crist@yahoo.com\",\n \"twitter_username\": \"\",\n \"organization_id\": \"\",\n },\n internal_organization={\n \"created_at\": dateutil.parser.isoparse(\"2025-12-13T11:00:39.217Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-02T09:51:26.214Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"slug\": \"\",\n \"avatar_url\": \"https://memorable-numeracy.com/\",\n \"bio\": \"\",\n \"company\": \"Schuster - Crooks\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Tatum.Block37@yahoo.com\",\n \"twitter_username\": \"\",\n \"pledge_minimum_amount\": 653584,\n \"pledge_badge_show_amount\": False,\n \"default_upfront_split_to_contributors\": 175899,\n \"profile_settings\": {},\n \"feature_settings\": {\n \"issue_funding_enabled\": False,\n },\n \"subscription_settings\": {\n \"allow_multiple_subscriptions\": False,\n \"allow_customer_updates\": True,\n \"proration_behavior\": polar_sdk.SubscriptionProrationBehavior.INVOICE,\n },\n },\n ),\n pledge_badge_currently_embedded=True,\n ),\n authed_can_admin_sender=False,\n authed_can_admin_received=False,\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointpledge_updated_post(request=polar_sdk.WebhookPledgeUpdatedPayload(\n type=\"pledge.updated\",\n data=polar_sdk.Pledge(\n created_at=dateutil.parser.isoparse(\"2024-11-29T00:10:39.674Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-10-02T21:42:49.754Z\"),\n id=\"\",\n amount=634567,\n currency=\"Singapore Dollar\",\n state=polar_sdk.PledgeState.REFUNDED,\n type=polar_sdk.PledgeType.PAY_ON_COMPLETION,\n issue=polar_sdk.Issue(\n id=\"d2e1349d-085a-441c-abf4-379a1f21d0da\",\n platform=polar_sdk.Platforms.GITHUB,\n number=218372,\n title=\"\",\n state=polar_sdk.State.CLOSED,\n issue_created_at=dateutil.parser.isoparse(\"2024-08-12T14:08:31.083Z\"),\n needs_confirmation_solved=True,\n funding=polar_sdk.Funding(),\n repository=polar_sdk.Repository(\n id=\"814bd7c6-3412-4f11-b523-7b38c659f44a\",\n platform=polar_sdk.Platforms.GITHUB,\n is_private=False,\n name=\"MyOrg\",\n description=\"hm however microchip\",\n stars=1337,\n license=\"\",\n homepage=\"\",\n profile_settings={},\n organization={\n \"id\": \"3ddd5cc2-de10-41ef-baa1-7551cf671cc3\",\n \"platform\": polar_sdk.Platforms.GITHUB,\n \"name\": \"\",\n \"avatar_url\": \"https://gummy-interviewer.biz\",\n \"is_personal\": False,\n \"bio\": \"\",\n \"pretty_name\": \"\",\n \"company\": \"Ferry - Tremblay\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Reggie_Crist@yahoo.com\",\n \"twitter_username\": \"\",\n \"organization_id\": \"\",\n },\n internal_organization={\n \"created_at\": dateutil.parser.isoparse(\"2025-12-13T11:00:39.217Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-02T09:51:26.214Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"slug\": \"\",\n \"avatar_url\": \"https://memorable-numeracy.com/\",\n \"bio\": \"\",\n \"company\": \"Schuster - Crooks\",\n \"blog\": \"\",\n \"location\": \"\",\n \"email\": \"Tatum.Block37@yahoo.com\",\n \"twitter_username\": \"\",\n \"pledge_minimum_amount\": 653584,\n \"pledge_badge_show_amount\": False,\n \"default_upfront_split_to_contributors\": 175899,\n \"profile_settings\": {},\n \"feature_settings\": {},\n \"subscription_settings\": {\n \"allow_multiple_subscriptions\": False,\n \"allow_customer_updates\": True,\n \"proration_behavior\": polar_sdk.SubscriptionProrationBehavior.INVOICE,\n },\n },\n ),\n pledge_badge_currently_embedded=True,\n ),\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["product.created"]["post"] update: "x-codeSamples": @@ -698,7 +752,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "Python (SDK)" - "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_active_post(request=polar_sdk.WebhookSubscriptionActivePayload(\n type=\"subscription.active\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2023-09-17T11:03:44.679Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-07-24T20:02:17.426Z\"),\n id=\"\",\n amount=116760,\n currency=\"Quetzal\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=dateutil.parser.isoparse(\"2023-08-25T00:14:50.252Z\"),\n current_period_end=dateutil.parser.isoparse(\"2023-12-10T18:25:01.577Z\"),\n cancel_at_period_end=False,\n canceled_at=dateutil.parser.isoparse(\"2024-07-05T14:07:23.099Z\"),\n started_at=dateutil.parser.isoparse(\"2024-06-30T08:12:48.355Z\"),\n ends_at=dateutil.parser.isoparse(\"2023-06-29T07:42:54.895Z\"),\n ended_at=dateutil.parser.isoparse(\"2025-10-30T02:51:06.576Z\"),\n customer_id=\"\",\n product_id=\"\",\n price_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.SWITCHED_SERVICE,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": True,\n \"key1\": \"\",\n \"key2\": 615212,\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2023-04-25T08:49:41.567Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-09-05T08:50:11.879Z\"),\n \"id\": \"\",\n \"metadata\": {\n\n },\n \"email\": \"Felicia87@hotmail.com\",\n \"email_verified\": True,\n \"name\": \"\",\n \"billing_address\": {\n \"country\": \"Cuba\",\n },\n \"tax_id\": [\n \"pe_ruc\",\n \"tr_tin\",\n ],\n \"organization_id\": \"\",\n \"avatar_url\": \"https://steel-zebra.biz/\",\n },\n user_id=\"\",\n user={\n \"id\": \"\",\n \"email\": \"Raven_Feil@gmail.com\",\n \"public_name\": \"\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2024-08-26T12:17:17.429Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-15T18:12:34.300Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"during boo place enchanting\",\n \"is_recurring\": False,\n \"is_archived\": False,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-05-08T23:16:06.519Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-23T21:06:29.057Z\"),\n \"id\": \"\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-25T00:14:50.252Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-10T18:25:01.577Z\"),\n \"id\": \"\",\n \"type\": \"ads\",\n \"description\": \"repeat catalyst wiggly table while amidst during\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"\",\n \"properties\": {},\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-06-02T05:19:01.352Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-07-07T22:15:53.860Z\"),\n \"id\": \"\",\n \"type\": \"ads\",\n \"description\": \"until below barring\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"\",\n \"properties\": {},\n },\n ],\n \"medias\": [\n {\n \"id\": \"\",\n \"organization_id\": \"\",\n \"name\": \"\",\n \"path\": \"/media\",\n \"mime_type\": \"\",\n \"size\": 931655,\n \"storage_version\": \"\",\n \"checksum_etag\": \"\",\n \"checksum_sha256_base64\": \"\",\n \"checksum_sha256_hex\": \"\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-06-07T17:40:48.757Z\"),\n \"version\": \"\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-07-27T18:04:02.928Z\"),\n \"size_readable\": \"\",\n \"public_url\": \"https://remorseful-hamburger.name\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-03-04T01:17:37.967Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-06-12T20:00:04.431Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"type\": \"number\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"\",\n \"properties\": {},\n },\n \"order\": 769742,\n \"required\": False,\n },\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-06-14T23:00:03.799Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-09T05:47:51.810Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"type\": \"number\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"\",\n \"properties\": {},\n },\n \"order\": 61975,\n \"required\": False,\n },\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2025-02-15T09:26:15.001Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-17T07:08:38.057Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"select\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"\",\n \"properties\": {\n \"options\": [\n {\n \"value\": \"\",\n \"label\": \"\",\n },\n ],\n },\n },\n \"order\": 531803,\n \"required\": True,\n },\n ],\n },\n price={\n \"created_at\": dateutil.parser.isoparse(\"2025-09-06T01:15:07.788Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-06-24T14:24:29.896Z\"),\n \"id\": \"\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"\",\n \"price_currency\": \"\",\n \"minimum_amount\": 135533,\n \"maximum_amount\": 811194,\n \"preset_amount\": 58418,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.REPEATING,\n \"type\": polar_sdk.DiscountType.PERCENTAGE,\n \"basis_points\": 722311,\n \"created_at\": dateutil.parser.isoparse(\"2025-09-04T07:15:12.730Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-10-06T11:12:50.335Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"name\": \"\",\n \"code\": \"\",\n \"starts_at\": dateutil.parser.isoparse(\"2025-11-16T18:30:55.860Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2025-02-08T03:34:15.957Z\"),\n \"max_redemptions\": 692583,\n \"redemptions_count\": 78638,\n \"organization_id\": \"\",\n },\n ),\n ))\n\n # Handle response\n print(res)" + "source": "import dateutil.parser\nimport polar_sdk\nfrom polar_sdk import Polar\n\nwith Polar() as polar:\n\n res = polar.endpointsubscription_active_post(request=polar_sdk.WebhookSubscriptionActivePayload(\n type=\"subscription.active\",\n data=polar_sdk.Subscription(\n created_at=dateutil.parser.isoparse(\"2023-09-17T11:03:44.679Z\"),\n modified_at=dateutil.parser.isoparse(\"2025-07-24T20:02:17.426Z\"),\n id=\"\",\n amount=116760,\n currency=\"Quetzal\",\n recurring_interval=polar_sdk.SubscriptionRecurringInterval.MONTH,\n status=polar_sdk.SubscriptionStatus.INCOMPLETE,\n current_period_start=dateutil.parser.isoparse(\"2023-08-25T00:14:50.252Z\"),\n current_period_end=dateutil.parser.isoparse(\"2023-12-10T18:25:01.577Z\"),\n cancel_at_period_end=False,\n canceled_at=dateutil.parser.isoparse(\"2024-07-05T14:07:23.099Z\"),\n started_at=dateutil.parser.isoparse(\"2024-06-30T08:12:48.355Z\"),\n ends_at=dateutil.parser.isoparse(\"2023-06-29T07:42:54.895Z\"),\n ended_at=dateutil.parser.isoparse(\"2025-10-30T02:51:06.576Z\"),\n customer_id=\"\",\n product_id=\"\",\n price_id=\"\",\n discount_id=\"\",\n checkout_id=\"\",\n customer_cancellation_reason=polar_sdk.CustomerCancellationReason.SWITCHED_SERVICE,\n customer_cancellation_comment=\"\",\n metadata={\n \"key\": True,\n \"key1\": \"\",\n \"key2\": 615212,\n },\n customer={\n \"created_at\": dateutil.parser.isoparse(\"2023-04-25T08:49:41.567Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-09-05T08:50:11.879Z\"),\n \"id\": \"\",\n \"metadata\": {\n\n },\n \"email\": \"Felicia87@hotmail.com\",\n \"email_verified\": True,\n \"name\": \"\",\n \"billing_address\": {\n \"country\": \"Cuba\",\n },\n \"tax_id\": [\n \"pe_ruc\",\n \"tr_tin\",\n ],\n \"organization_id\": \"\",\n \"avatar_url\": \"https://steel-zebra.biz/\",\n },\n user_id=\"\",\n user={\n \"id\": \"\",\n \"email\": \"Raven_Feil@gmail.com\",\n \"public_name\": \"\",\n },\n product={\n \"created_at\": dateutil.parser.isoparse(\"2024-08-26T12:17:17.429Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-06-15T18:12:34.300Z\"),\n \"id\": \"\",\n \"name\": \"\",\n \"description\": \"during boo place enchanting\",\n \"is_recurring\": False,\n \"is_archived\": False,\n \"organization_id\": \"\",\n \"metadata\": {\n\n },\n \"prices\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-05-08T23:16:06.519Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-23T21:06:29.057Z\"),\n \"id\": \"\",\n \"amount_type\": \"free\",\n \"is_archived\": False,\n \"product_id\": \"\",\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n ],\n \"benefits\": [\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-08-25T00:14:50.252Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-12-10T18:25:01.577Z\"),\n \"id\": \"\",\n \"type\": \"ads\",\n \"description\": \"repeat catalyst wiggly table while amidst during\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"\",\n \"properties\": {\n \"image_height\": 400,\n \"image_width\": 400,\n },\n },\n {\n \"created_at\": dateutil.parser.isoparse(\"2023-06-02T05:19:01.352Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-07-07T22:15:53.860Z\"),\n \"id\": \"\",\n \"type\": \"ads\",\n \"description\": \"until below barring\",\n \"selectable\": False,\n \"deletable\": False,\n \"organization_id\": \"\",\n \"properties\": {\n \"image_height\": 400,\n \"image_width\": 400,\n },\n },\n ],\n \"medias\": [\n {\n \"id\": \"\",\n \"organization_id\": \"\",\n \"name\": \"\",\n \"path\": \"/media\",\n \"mime_type\": \"\",\n \"size\": 931655,\n \"storage_version\": \"\",\n \"checksum_etag\": \"\",\n \"checksum_sha256_base64\": \"\",\n \"checksum_sha256_hex\": \"\",\n \"last_modified_at\": dateutil.parser.isoparse(\"2023-06-07T17:40:48.757Z\"),\n \"version\": \"\",\n \"service\": \"product_media\",\n \"is_uploaded\": False,\n \"created_at\": dateutil.parser.isoparse(\"2024-07-27T18:04:02.928Z\"),\n \"size_readable\": \"\",\n \"public_url\": \"https://remorseful-hamburger.name\",\n },\n ],\n \"attached_custom_fields\": [\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2024-03-04T01:17:37.967Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2023-06-12T20:00:04.431Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"type\": \"number\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"\",\n \"properties\": {},\n },\n \"order\": 769742,\n \"required\": False,\n },\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2023-06-14T23:00:03.799Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-02-09T05:47:51.810Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"type\": \"number\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"\",\n \"properties\": {},\n },\n \"order\": 61975,\n \"required\": False,\n },\n {\n \"custom_field_id\": \"\",\n \"custom_field\": {\n \"created_at\": dateutil.parser.isoparse(\"2025-02-15T09:26:15.001Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-12-17T07:08:38.057Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": False,\n },\n \"type\": \"select\",\n \"slug\": \"\",\n \"name\": \"\",\n \"organization_id\": \"\",\n \"properties\": {\n \"options\": [\n {\n \"value\": \"\",\n \"label\": \"\",\n },\n ],\n },\n },\n \"order\": 531803,\n \"required\": True,\n },\n ],\n },\n price={\n \"created_at\": dateutil.parser.isoparse(\"2025-09-06T01:15:07.788Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2024-06-24T14:24:29.896Z\"),\n \"id\": \"\",\n \"amount_type\": \"custom\",\n \"is_archived\": False,\n \"product_id\": \"\",\n \"price_currency\": \"\",\n \"minimum_amount\": 135533,\n \"maximum_amount\": 811194,\n \"preset_amount\": 58418,\n \"type\": \"recurring\",\n \"recurring_interval\": polar_sdk.SubscriptionRecurringInterval.MONTH,\n },\n discount={\n \"duration\": polar_sdk.DiscountDuration.REPEATING,\n \"type\": polar_sdk.DiscountType.PERCENTAGE,\n \"basis_points\": 722311,\n \"created_at\": dateutil.parser.isoparse(\"2025-09-04T07:15:12.730Z\"),\n \"modified_at\": dateutil.parser.isoparse(\"2025-10-06T11:12:50.335Z\"),\n \"id\": \"\",\n \"metadata\": {\n \"key\": \"\",\n },\n \"name\": \"\",\n \"code\": \"\",\n \"starts_at\": dateutil.parser.isoparse(\"2025-11-16T18:30:55.860Z\"),\n \"ends_at\": dateutil.parser.isoparse(\"2025-02-08T03:34:15.957Z\"),\n \"max_redemptions\": 692583,\n \"redemptions_count\": 78638,\n \"organization_id\": \"\",\n },\n ),\n ))\n\n # Handle response\n print(res)" - target: $["paths"]["subscription.canceled"]["post"] update: "x-codeSamples": diff --git a/docs/models/aggregation.md b/docs/models/aggregation.md new file mode 100644 index 00000000..e8619599 --- /dev/null +++ b/docs/models/aggregation.md @@ -0,0 +1,35 @@ +# Aggregation + + +## Supported Types + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.CountAggregation` + +```python +value: models.CountAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + diff --git a/docs/models/clauses.md b/docs/models/clauses.md new file mode 100644 index 00000000..53ec1b29 --- /dev/null +++ b/docs/models/clauses.md @@ -0,0 +1,17 @@ +# Clauses + + +## Supported Types + +### `models.FilterClause` + +```python +value: models.FilterClause = /* values here */ +``` + +### `models.Filter` + +```python +value: models.Filter = /* values here */ +``` + diff --git a/docs/models/countaggregation.md b/docs/models/countaggregation.md new file mode 100644 index 00000000..94d1bb67 --- /dev/null +++ b/docs/models/countaggregation.md @@ -0,0 +1,8 @@ +# CountAggregation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `func` | *Optional[Literal["count"]]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/event.md b/docs/models/event.md new file mode 100644 index 00000000..135b54f8 --- /dev/null +++ b/docs/models/event.md @@ -0,0 +1,15 @@ +# Event + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `metadata` | Dict[str, [models.EventMetadata](../models/eventmetadata.md)] | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The timestamp of the event. | +| `name` | *str* | :heavy_check_mark: | The name of the event. | +| `source` | [models.EventSource](../models/eventsource.md) | :heavy_check_mark: | N/A | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the event. | +| `customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | +| `external_customer_id` | *Nullable[str]* | :heavy_check_mark: | ID of the customer in your system associated with the event. | \ No newline at end of file diff --git a/docs/models/eventcreatecustomer.md b/docs/models/eventcreatecustomer.md new file mode 100644 index 00000000..5ef9f8f5 --- /dev/null +++ b/docs/models/eventcreatecustomer.md @@ -0,0 +1,12 @@ +# EventCreateCustomer + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the event. | +| `customer_id` | *str* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | +| `metadata` | Dict[str, [models.EventCreateCustomerMetadata](../models/eventcreatecustomermetadata.md)] | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The timestamp of the event. | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the event. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/models/eventcreatecustomermetadata.md b/docs/models/eventcreatecustomermetadata.md new file mode 100644 index 00000000..6d8f7aac --- /dev/null +++ b/docs/models/eventcreatecustomermetadata.md @@ -0,0 +1,23 @@ +# EventCreateCustomerMetadata + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/eventcreateexternalcustomer.md b/docs/models/eventcreateexternalcustomer.md new file mode 100644 index 00000000..4de5255d --- /dev/null +++ b/docs/models/eventcreateexternalcustomer.md @@ -0,0 +1,12 @@ +# EventCreateExternalCustomer + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the event. | +| `external_customer_id` | *str* | :heavy_check_mark: | ID of the customer in your system associated with the event. | +| `metadata` | Dict[str, [models.EventCreateExternalCustomerMetadata](../models/eventcreateexternalcustomermetadata.md)] | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The timestamp of the event. | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the event. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/models/eventcreateexternalcustomermetadata.md b/docs/models/eventcreateexternalcustomermetadata.md new file mode 100644 index 00000000..210fe6df --- /dev/null +++ b/docs/models/eventcreateexternalcustomermetadata.md @@ -0,0 +1,23 @@ +# EventCreateExternalCustomerMetadata + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/eventmetadata.md b/docs/models/eventmetadata.md new file mode 100644 index 00000000..88e0031d --- /dev/null +++ b/docs/models/eventmetadata.md @@ -0,0 +1,23 @@ +# EventMetadata + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/eventsgetrequest.md b/docs/models/eventsgetrequest.md new file mode 100644 index 00000000..b05ce0c6 --- /dev/null +++ b/docs/models/eventsgetrequest.md @@ -0,0 +1,8 @@ +# EventsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | The event ID. | \ No newline at end of file diff --git a/docs/models/eventsingest.md b/docs/models/eventsingest.md new file mode 100644 index 00000000..b707cb9d --- /dev/null +++ b/docs/models/eventsingest.md @@ -0,0 +1,8 @@ +# EventsIngest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `events` | List[[models.EventsModel](../models/eventsmodel.md)] | :heavy_check_mark: | List of events to ingest. | \ No newline at end of file diff --git a/docs/models/eventsingestresponse.md b/docs/models/eventsingestresponse.md new file mode 100644 index 00000000..fe22bf8c --- /dev/null +++ b/docs/models/eventsingestresponse.md @@ -0,0 +1,8 @@ +# EventsIngestResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `inserted` | *int* | :heavy_check_mark: | Number of events inserted. | \ No newline at end of file diff --git a/docs/models/eventslistqueryparamcustomeridfilter.md b/docs/models/eventslistqueryparamcustomeridfilter.md new file mode 100644 index 00000000..7f4b7b3c --- /dev/null +++ b/docs/models/eventslistqueryparamcustomeridfilter.md @@ -0,0 +1,19 @@ +# EventsListQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/eventslistqueryparamorganizationidfilter.md b/docs/models/eventslistqueryparamorganizationidfilter.md new file mode 100644 index 00000000..6193e2a3 --- /dev/null +++ b/docs/models/eventslistqueryparamorganizationidfilter.md @@ -0,0 +1,19 @@ +# EventsListQueryParamOrganizationIDFilter + +Filter by organization ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/eventslistrequest.md b/docs/models/eventslistrequest.md new file mode 100644 index 00000000..9f8fca9b --- /dev/null +++ b/docs/models/eventslistrequest.md @@ -0,0 +1,17 @@ +# EventsListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter events after this timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter events before this timestamp. | +| `organization_id` | [OptionalNullable[models.EventsListQueryParamOrganizationIDFilter]](../models/eventslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customer_id` | [OptionalNullable[models.EventsListQueryParamCustomerIDFilter]](../models/eventslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `external_customer_id` | [OptionalNullable[models.ExternalCustomerIDFilter]](../models/externalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `source` | [OptionalNullable[models.SourceFilter]](../models/sourcefilter.md) | :heavy_minus_sign: | Filter by event source. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.EventSortProperty](../models/eventsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | Dict[str, [models.MetadataQuery](../models/metadataquery.md)] | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | \ No newline at end of file diff --git a/docs/models/eventslistresponse.md b/docs/models/eventslistresponse.md new file mode 100644 index 00000000..0fdc8c65 --- /dev/null +++ b/docs/models/eventslistresponse.md @@ -0,0 +1,8 @@ +# EventsListResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `result` | [models.ListResourceEvent](../models/listresourceevent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/eventsmodel.md b/docs/models/eventsmodel.md new file mode 100644 index 00000000..29f82fdd --- /dev/null +++ b/docs/models/eventsmodel.md @@ -0,0 +1,17 @@ +# EventsModel + + +## Supported Types + +### `models.EventCreateCustomer` + +```python +value: models.EventCreateCustomer = /* values here */ +``` + +### `models.EventCreateExternalCustomer` + +```python +value: models.EventCreateExternalCustomer = /* values here */ +``` + diff --git a/docs/models/eventsortproperty.md b/docs/models/eventsortproperty.md new file mode 100644 index 00000000..472d1c4f --- /dev/null +++ b/docs/models/eventsortproperty.md @@ -0,0 +1,9 @@ +# EventSortProperty + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `TIMESTAMP` | timestamp | +| `MINUS_TIMESTAMP` | -timestamp | \ No newline at end of file diff --git a/docs/models/eventsource.md b/docs/models/eventsource.md new file mode 100644 index 00000000..c2897bfb --- /dev/null +++ b/docs/models/eventsource.md @@ -0,0 +1,9 @@ +# EventSource + + +## Values + +| Name | Value | +| -------- | -------- | +| `SYSTEM` | system | +| `USER` | user | \ No newline at end of file diff --git a/docs/models/externalcustomeridfilter.md b/docs/models/externalcustomeridfilter.md new file mode 100644 index 00000000..008ec68e --- /dev/null +++ b/docs/models/externalcustomeridfilter.md @@ -0,0 +1,19 @@ +# ExternalCustomerIDFilter + +Filter by external customer ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/filter_.md b/docs/models/filter_.md new file mode 100644 index 00000000..ee4e0733 --- /dev/null +++ b/docs/models/filter_.md @@ -0,0 +1,9 @@ +# Filter + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `conjunction` | [models.FilterConjunction](../models/filterconjunction.md) | :heavy_check_mark: | N/A | +| `clauses` | List[[models.Clauses](../models/clauses.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filterclause.md b/docs/models/filterclause.md new file mode 100644 index 00000000..b97f5327 --- /dev/null +++ b/docs/models/filterclause.md @@ -0,0 +1,10 @@ +# FilterClause + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `property` | *str* | :heavy_check_mark: | N/A | +| `operator` | [models.FilterOperator](../models/filteroperator.md) | :heavy_check_mark: | N/A | +| `value` | [models.Value](../models/value.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filterconjunction.md b/docs/models/filterconjunction.md new file mode 100644 index 00000000..6e5706d2 --- /dev/null +++ b/docs/models/filterconjunction.md @@ -0,0 +1,9 @@ +# FilterConjunction + + +## Values + +| Name | Value | +| ----- | ----- | +| `AND` | and | +| `OR` | or | \ No newline at end of file diff --git a/docs/models/filteroperator.md b/docs/models/filteroperator.md new file mode 100644 index 00000000..078c632a --- /dev/null +++ b/docs/models/filteroperator.md @@ -0,0 +1,15 @@ +# FilterOperator + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `EQ` | eq | +| `NE` | ne | +| `GT` | gt | +| `GTE` | gte | +| `LT` | lt | +| `LTE` | lte | +| `LIKE` | like | +| `NOT_LIKE` | not_like | \ No newline at end of file diff --git a/docs/models/func.md b/docs/models/func.md new file mode 100644 index 00000000..00055e11 --- /dev/null +++ b/docs/models/func.md @@ -0,0 +1,11 @@ +# Func + + +## Values + +| Name | Value | +| ----- | ----- | +| `SUM` | sum | +| `MAX` | max | +| `MIN` | min | +| `AVG` | avg | \ No newline at end of file diff --git a/docs/models/listresourceevent.md b/docs/models/listresourceevent.md new file mode 100644 index 00000000..2bb66377 --- /dev/null +++ b/docs/models/listresourceevent.md @@ -0,0 +1,9 @@ +# ListResourceEvent + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `items` | List[[models.Event](../models/event.md)] | :heavy_check_mark: | N/A | +| `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listresourcemeter.md b/docs/models/listresourcemeter.md new file mode 100644 index 00000000..9bacbe52 --- /dev/null +++ b/docs/models/listresourcemeter.md @@ -0,0 +1,9 @@ +# ListResourceMeter + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `items` | List[[models.Meter](../models/meter.md)] | :heavy_check_mark: | N/A | +| `pagination` | [models.Pagination](../models/pagination.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/meter.md b/docs/models/meter.md new file mode 100644 index 00000000..57e3b636 --- /dev/null +++ b/docs/models/meter.md @@ -0,0 +1,15 @@ +# Meter + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `metadata` | Dict[str, [models.MeterMetadata](../models/metermetadata.md)] | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Creation timestamp of the object. | +| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Last modification timestamp of the object. | +| `id` | *str* | :heavy_check_mark: | The ID of the object. | +| `name` | *str* | :heavy_check_mark: | The name of the meter. Will be shown on customer's invoices and usage. | +| `filter_` | [models.Filter](../models/filter_.md) | :heavy_check_mark: | N/A | +| `aggregation` | [models.MeterAggregation](../models/meteraggregation.md) | :heavy_check_mark: | The aggregation to apply on the filtered events to calculate the meter. | +| `organization_id` | *str* | :heavy_check_mark: | The ID of the organization owning the meter. | \ No newline at end of file diff --git a/docs/models/meteraggregation.md b/docs/models/meteraggregation.md new file mode 100644 index 00000000..816933d9 --- /dev/null +++ b/docs/models/meteraggregation.md @@ -0,0 +1,37 @@ +# MeterAggregation + +The aggregation to apply on the filtered events to calculate the meter. + + +## Supported Types + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.CountAggregation` + +```python +value: models.CountAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + diff --git a/docs/models/metercreate.md b/docs/models/metercreate.md new file mode 100644 index 00000000..0190038e --- /dev/null +++ b/docs/models/metercreate.md @@ -0,0 +1,12 @@ +# MeterCreate + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the meter. Will be shown on customer's invoices and usage. | +| `filter_` | [models.Filter](../models/filter_.md) | :heavy_check_mark: | N/A | +| `aggregation` | [models.MeterCreateAggregation](../models/metercreateaggregation.md) | :heavy_check_mark: | The aggregation to apply on the filtered events to calculate the meter. | +| `metadata` | Dict[str, [models.MeterCreateMetadata](../models/metercreatemetadata.md)] | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `organization_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the organization owning the meter. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/models/metercreateaggregation.md b/docs/models/metercreateaggregation.md new file mode 100644 index 00000000..6c08a8dd --- /dev/null +++ b/docs/models/metercreateaggregation.md @@ -0,0 +1,37 @@ +# MeterCreateAggregation + +The aggregation to apply on the filtered events to calculate the meter. + + +## Supported Types + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.CountAggregation` + +```python +value: models.CountAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + +### `models.PropertyAggregation` + +```python +value: models.PropertyAggregation = /* values here */ +``` + diff --git a/docs/models/metercreatemetadata.md b/docs/models/metercreatemetadata.md new file mode 100644 index 00000000..73ea6cd2 --- /dev/null +++ b/docs/models/metercreatemetadata.md @@ -0,0 +1,23 @@ +# MeterCreateMetadata + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/metermetadata.md b/docs/models/metermetadata.md new file mode 100644 index 00000000..1baf41bf --- /dev/null +++ b/docs/models/metermetadata.md @@ -0,0 +1,23 @@ +# MeterMetadata + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/meterquantities.md b/docs/models/meterquantities.md new file mode 100644 index 00000000..efdcd08c --- /dev/null +++ b/docs/models/meterquantities.md @@ -0,0 +1,8 @@ +# MeterQuantities + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `quantities` | List[[models.MeterQuantity](../models/meterquantity.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/meterquantity.md b/docs/models/meterquantity.md new file mode 100644 index 00000000..d7941c01 --- /dev/null +++ b/docs/models/meterquantity.md @@ -0,0 +1,9 @@ +# MeterQuantity + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The timestamp for the current period. | +| `quantity` | *float* | :heavy_check_mark: | The quantity for the current period. | \ No newline at end of file diff --git a/docs/models/meterseventsrequest.md b/docs/models/meterseventsrequest.md new file mode 100644 index 00000000..4c162286 --- /dev/null +++ b/docs/models/meterseventsrequest.md @@ -0,0 +1,10 @@ +# MetersEventsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | \ No newline at end of file diff --git a/docs/models/meterseventsresponse.md b/docs/models/meterseventsresponse.md new file mode 100644 index 00000000..c06e898b --- /dev/null +++ b/docs/models/meterseventsresponse.md @@ -0,0 +1,8 @@ +# MetersEventsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `result` | [models.ListResourceEvent](../models/listresourceevent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/metersgetrequest.md b/docs/models/metersgetrequest.md new file mode 100644 index 00000000..8d2a0723 --- /dev/null +++ b/docs/models/metersgetrequest.md @@ -0,0 +1,8 @@ +# MetersGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | The meter ID. | \ No newline at end of file diff --git a/docs/models/meterslistqueryparamorganizationidfilter.md b/docs/models/meterslistqueryparamorganizationidfilter.md new file mode 100644 index 00000000..37c722bf --- /dev/null +++ b/docs/models/meterslistqueryparamorganizationidfilter.md @@ -0,0 +1,19 @@ +# MetersListQueryParamOrganizationIDFilter + +Filter by organization ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/meterslistrequest.md b/docs/models/meterslistrequest.md new file mode 100644 index 00000000..a6f1a0d0 --- /dev/null +++ b/docs/models/meterslistrequest.md @@ -0,0 +1,13 @@ +# MetersListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.MetersListQueryParamOrganizationIDFilter]](../models/meterslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by name. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.MeterSortProperty](../models/metersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | Dict[str, [models.MetadataQuery](../models/metadataquery.md)] | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | \ No newline at end of file diff --git a/docs/models/meterslistresponse.md b/docs/models/meterslistresponse.md new file mode 100644 index 00000000..07929a9f --- /dev/null +++ b/docs/models/meterslistresponse.md @@ -0,0 +1,8 @@ +# MetersListResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `result` | [models.ListResourceMeter](../models/listresourcemeter.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/metersortproperty.md b/docs/models/metersortproperty.md new file mode 100644 index 00000000..e80bfa80 --- /dev/null +++ b/docs/models/metersortproperty.md @@ -0,0 +1,11 @@ +# MeterSortProperty + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `CREATED_AT` | created_at | +| `MINUS_CREATED_AT` | -created_at | +| `NAME` | name | +| `MINUS_NAME` | -name | \ No newline at end of file diff --git a/docs/models/metersquantitiesqueryparamcustomeridfilter.md b/docs/models/metersquantitiesqueryparamcustomeridfilter.md new file mode 100644 index 00000000..62bfc4a1 --- /dev/null +++ b/docs/models/metersquantitiesqueryparamcustomeridfilter.md @@ -0,0 +1,19 @@ +# MetersQuantitiesQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/metersquantitiesrequest.md b/docs/models/metersquantitiesrequest.md new file mode 100644 index 00000000..6706f5a6 --- /dev/null +++ b/docs/models/metersquantitiesrequest.md @@ -0,0 +1,13 @@ +# MetersQuantitiesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Start timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | End timestamp. | +| `interval` | [models.TimeInterval](../models/timeinterval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `customer_id` | [OptionalNullable[models.MetersQuantitiesQueryParamCustomerIDFilter]](../models/metersquantitiesqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `exernal_customer_id` | [OptionalNullable[models.QueryParamExternalCustomerIDFilter]](../models/queryparamexternalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | \ No newline at end of file diff --git a/docs/models/metersupdaterequest.md b/docs/models/metersupdaterequest.md new file mode 100644 index 00000000..7b9aec3e --- /dev/null +++ b/docs/models/metersupdaterequest.md @@ -0,0 +1,9 @@ +# MetersUpdateRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `meter_update` | [models.MeterUpdate](../models/meterupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/meterupdate.md b/docs/models/meterupdate.md new file mode 100644 index 00000000..73e1edc4 --- /dev/null +++ b/docs/models/meterupdate.md @@ -0,0 +1,11 @@ +# MeterUpdate + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `metadata` | Dict[str, [models.MeterUpdateMetadata](../models/meterupdatemetadata.md)] | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the meter. Will be shown on customer's invoices and usage. | +| `filter_` | [OptionalNullable[models.Filter]](../models/filter_.md) | :heavy_minus_sign: | The filter to apply on events that'll be used to calculate the meter. | +| `aggregation` | [OptionalNullable[models.Aggregation]](../models/aggregation.md) | :heavy_minus_sign: | The aggregation to apply on the filtered events to calculate the meter. | \ No newline at end of file diff --git a/docs/models/meterupdatemetadata.md b/docs/models/meterupdatemetadata.md new file mode 100644 index 00000000..ffbd23ab --- /dev/null +++ b/docs/models/meterupdatemetadata.md @@ -0,0 +1,23 @@ +# MeterUpdateMetadata + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/metricsgetrequest.md b/docs/models/metricsgetrequest.md index ae306eae..7e403c0f 100644 --- a/docs/models/metricsgetrequest.md +++ b/docs/models/metricsgetrequest.md @@ -7,7 +7,7 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `start_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_check_mark: | Start date. | | `end_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_check_mark: | End date. | -| `interval` | [models.Interval](../models/interval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `interval` | [models.TimeInterval](../models/timeinterval.md) | :heavy_check_mark: | Interval between two timestamps. | | `organization_id` | [OptionalNullable[models.MetricsGetQueryParamOrganizationIDFilter]](../models/metricsgetqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `product_id` | [OptionalNullable[models.MetricsGetQueryParamProductIDFilter]](../models/metricsgetqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | | `product_price_type` | [OptionalNullable[models.QueryParamProductPriceTypeFilter]](../models/queryparamproductpricetypefilter.md) | :heavy_minus_sign: | Filter by product price type. `recurring` will filter data corresponding to subscriptions creations or renewals. `one_time` will filter data corresponding to one-time purchases. | diff --git a/docs/models/propertyaggregation.md b/docs/models/propertyaggregation.md new file mode 100644 index 00000000..0213bcaf --- /dev/null +++ b/docs/models/propertyaggregation.md @@ -0,0 +1,9 @@ +# PropertyAggregation + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `func` | [models.Func](../models/func.md) | :heavy_check_mark: | N/A | +| `property` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/queryparamexternalcustomeridfilter.md b/docs/models/queryparamexternalcustomeridfilter.md new file mode 100644 index 00000000..49a8adf9 --- /dev/null +++ b/docs/models/queryparamexternalcustomeridfilter.md @@ -0,0 +1,19 @@ +# QueryParamExternalCustomerIDFilter + +Filter by external customer ID. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/docs/models/scope.md b/docs/models/scope.md index dee71f9f..a22b8f86 100644 --- a/docs/models/scope.md +++ b/docs/models/scope.md @@ -27,6 +27,8 @@ | `BENEFITS_WRITE` | benefits:write | | `EVENTS_READ` | events:read | | `EVENTS_WRITE` | events:write | +| `METERS_READ` | meters:read | +| `METERS_WRITE` | meters:write | | `FILES_READ` | files:read | | `FILES_WRITE` | files:write | | `SUBSCRIPTIONS_READ` | subscriptions:read | diff --git a/docs/models/sourcefilter.md b/docs/models/sourcefilter.md new file mode 100644 index 00000000..b53c70ab --- /dev/null +++ b/docs/models/sourcefilter.md @@ -0,0 +1,19 @@ +# SourceFilter + +Filter by event source. + + +## Supported Types + +### `models.EventSource` + +```python +value: models.EventSource = /* values here */ +``` + +### `List[models.EventSource]` + +```python +value: List[models.EventSource] = /* values here */ +``` + diff --git a/docs/models/interval.md b/docs/models/timeinterval.md similarity index 91% rename from docs/models/interval.md rename to docs/models/timeinterval.md index b4369b9c..7c660923 100644 --- a/docs/models/interval.md +++ b/docs/models/timeinterval.md @@ -1,4 +1,4 @@ -# Interval +# TimeInterval ## Values diff --git a/docs/models/value.md b/docs/models/value.md new file mode 100644 index 00000000..7a372a1c --- /dev/null +++ b/docs/models/value.md @@ -0,0 +1,23 @@ +# Value + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/sdks/advertisements/README.md b/docs/sdks/advertisements/README.md index cdd86748..e0f822f9 100644 --- a/docs/sdks/advertisements/README.md +++ b/docs/sdks/advertisements/README.md @@ -21,7 +21,7 @@ with Polar( access_token="", ) as polar: - res = polar.advertisements.list(benefit_id="", page=1, limit=10) + res = polar.advertisements.list(benefit_id="") while res is not None: # Handle items diff --git a/docs/sdks/benefitgrants/README.md b/docs/sdks/benefitgrants/README.md index ada1c36c..6d94afca 100644 --- a/docs/sdks/benefitgrants/README.md +++ b/docs/sdks/benefitgrants/README.md @@ -22,7 +22,7 @@ with Polar( access_token="", ) as polar: - res = polar.customer_portal.benefit_grants.list(page=1, limit=10) + res = polar.customer_portal.benefit_grants.list() while res is not None: # Handle items diff --git a/docs/sdks/benefits/README.md b/docs/sdks/benefits/README.md index 4a908870..5a0b2d34 100644 --- a/docs/sdks/benefits/README.md +++ b/docs/sdks/benefits/README.md @@ -25,7 +25,7 @@ with Polar( access_token="", ) as polar: - res = polar.benefits.list(page=1, limit=10) + res = polar.benefits.list() while res is not None: # Handle items @@ -236,7 +236,7 @@ with Polar( access_token="", ) as polar: - res = polar.benefits.grants(id="", page=1, limit=10) + res = polar.benefits.grants(id="") while res is not None: # Handle items diff --git a/docs/sdks/checkoutlinks/README.md b/docs/sdks/checkoutlinks/README.md index 8052c8a2..2c36fafa 100644 --- a/docs/sdks/checkoutlinks/README.md +++ b/docs/sdks/checkoutlinks/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.checkout_links.list(page=1, limit=10) + res = polar.checkout_links.list() while res is not None: # Handle items @@ -71,6 +71,7 @@ with Polar( res = polar.checkout_links.create(request={ "product_id": "", "payment_processor": "stripe", + "allow_discount_codes": True, }) # Handle response diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index f25a8f30..0f9a5a74 100644 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.oauth2.clients.list(page=1, limit=10) + res = polar.oauth2.clients.list() while res is not None: # Handle items @@ -59,7 +59,6 @@ Create an OAuth2 client. ### Example Usage ```python -import polar_sdk from polar_sdk import Polar with Polar( @@ -71,8 +70,6 @@ with Polar( "https://inferior-chainstay.com", ], "client_name": "", - "token_endpoint_auth_method": polar_sdk.OAuth2ClientConfigurationTokenEndpointAuthMethod.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 products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write 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", }) # Handle response @@ -143,7 +140,6 @@ Update an OAuth2 client. ### Example Usage ```python -import polar_sdk from polar_sdk import Polar with Polar( @@ -158,8 +154,6 @@ with Polar( ], "client_name": "", "client_id": "", - "token_endpoint_auth_method": polar_sdk.OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod.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 products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write 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", }) # Handle response diff --git a/docs/sdks/custom/README.md b/docs/sdks/custom/README.md index e6d58cf3..8524b588 100644 --- a/docs/sdks/custom/README.md +++ b/docs/sdks/custom/README.md @@ -26,7 +26,7 @@ with Polar( access_token="", ) as polar: - res = polar.checkouts.custom.list(page=1, limit=10) + res = polar.checkouts.custom.list() while res is not None: # Handle items diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index 75e7e816..3f04a7a8 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.customers.list(page=1, limit=10) + res = polar.customers.list() while res is not None: # Handle items diff --git a/docs/sdks/customfields/README.md b/docs/sdks/customfields/README.md index c6d098c6..a05dc4c1 100644 --- a/docs/sdks/customfields/README.md +++ b/docs/sdks/customfields/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.custom_fields.list(page=1, limit=10) + res = polar.custom_fields.list() while res is not None: # Handle items diff --git a/docs/sdks/discounts/README.md b/docs/sdks/discounts/README.md index d9673c41..c26177a5 100644 --- a/docs/sdks/discounts/README.md +++ b/docs/sdks/discounts/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.discounts.list(page=1, limit=10) + res = polar.discounts.list() while res is not None: # Handle items @@ -153,9 +153,7 @@ with Polar( access_token="", ) as polar: - res = polar.discounts.update(id="", discount_update={ - "currency": "usd", - }) + res = polar.discounts.update(id="", discount_update={}) # Handle response print(res) diff --git a/docs/sdks/downloadables/README.md b/docs/sdks/downloadables/README.md index b4b081dd..6070778e 100644 --- a/docs/sdks/downloadables/README.md +++ b/docs/sdks/downloadables/README.md @@ -21,7 +21,7 @@ with Polar( access_token="", ) as polar: - res = polar.customer_portal.downloadables.list(page=1, limit=10) + res = polar.customer_portal.downloadables.list() while res is not None: # Handle items diff --git a/docs/sdks/events/README.md b/docs/sdks/events/README.md new file mode 100644 index 00000000..db21be7e --- /dev/null +++ b/docs/sdks/events/README.md @@ -0,0 +1,147 @@ +# Events +(*events*) + +## Overview + +### Available Operations + +* [list](#list) - List Events +* [get](#get) - Get Event +* [ingest](#ingest) - Ingest Events + +## list + +List events. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.events.list() + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter events after this timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter events before this timestamp. | +| `organization_id` | [OptionalNullable[models.EventsListQueryParamOrganizationIDFilter]](../../models/eventslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customer_id` | [OptionalNullable[models.EventsListQueryParamCustomerIDFilter]](../../models/eventslistqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `external_customer_id` | [OptionalNullable[models.ExternalCustomerIDFilter]](../../models/externalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `source` | [OptionalNullable[models.SourceFilter]](../../models/sourcefilter.md) | :heavy_minus_sign: | Filter by event source. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.EventSortProperty](../../models/eventsortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | Dict[str, [models.MetadataQuery](../../models/metadataquery.md)] | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.EventsListResponse](../../models/eventslistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get an event by ID. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.events.get(id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The event ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Event](../../models/event.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## ingest + +Ingest batch of events. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.events.ingest(request={ + "events": [ + { + "name": "", + "customer_id": "", + }, + { + "name": "", + "external_customer_id": "", + }, + ], + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.EventsIngest](../../models/eventsingest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.EventsIngestResponse](../../models/eventsingestresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/externalorganizations/README.md b/docs/sdks/externalorganizations/README.md index cbaa7cd7..47bd81bf 100644 --- a/docs/sdks/externalorganizations/README.md +++ b/docs/sdks/externalorganizations/README.md @@ -20,7 +20,7 @@ with Polar( access_token="", ) as polar: - res = polar.external_organizations.list(page=1, limit=10) + res = polar.external_organizations.list() while res is not None: # Handle items diff --git a/docs/sdks/files/README.md b/docs/sdks/files/README.md index 861eae6e..2231e269 100644 --- a/docs/sdks/files/README.md +++ b/docs/sdks/files/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.files.list(page=1, limit=10) + res = polar.files.list() while res is not None: # Handle items diff --git a/docs/sdks/licensekeys/README.md b/docs/sdks/licensekeys/README.md index 2cd96e01..0e973549 100644 --- a/docs/sdks/licensekeys/README.md +++ b/docs/sdks/licensekeys/README.md @@ -23,7 +23,7 @@ with Polar( access_token="", ) as polar: - res = polar.license_keys.list(page=1, limit=10) + res = polar.license_keys.list() while res is not None: # Handle items @@ -108,9 +108,7 @@ with Polar( access_token="", ) as polar: - res = polar.license_keys.update(id="", license_key_update={ - "usage": 0, - }) + res = polar.license_keys.update(id="", license_key_update={}) # Handle response print(res) diff --git a/docs/sdks/meters/README.md b/docs/sdks/meters/README.md new file mode 100644 index 00000000..d8b7f280 --- /dev/null +++ b/docs/sdks/meters/README.md @@ -0,0 +1,277 @@ +# Meters +(*meters*) + +## Overview + +### Available Operations + +* [list](#list) - List Meters +* [create](#create) - Create Meter +* [get](#get) - Get Meter +* [update](#update) - Update Meter +* [events](#events) - Get Meter Events +* [quantities](#quantities) - Get Meter Quantities + +## list + +List meters. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.meters.list() + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organization_id` | [OptionalNullable[models.MetersListQueryParamOrganizationIDFilter]](../../models/meterslistqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `query` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by name. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `sorting` | List[[models.MeterSortProperty](../../models/metersortproperty.md)] | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | Dict[str, [models.MetadataQuery](../../models/metadataquery.md)] | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MetersListResponse](../../models/meterslistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## create + +Create a meter. + +### Example Usage + +```python +import polar_sdk +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.meters.create(request={ + "name": "", + "filter_": { + "conjunction": polar_sdk.FilterConjunction.AND, + "clauses": [ + + ], + }, + "aggregation": { + "func": polar_sdk.Func.SUM, + "property": "", + }, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [models.MeterCreate](../../models/metercreate.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Meter](../../models/meter.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get a meter by ID. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.meters.get(id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Meter](../../models/meter.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## update + +Update a meter. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.meters.update(id="", meter_update={}) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `meter_update` | [models.MeterUpdate](../../models/meterupdate.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Meter](../../models/meter.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## events + +Get events matching the filter of a meter. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.meters.events(id="") + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MetersEventsResponse](../../models/meterseventsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | + +## quantities + +Get quantities of a meter over a time period. + +### Example Usage + +```python +import dateutil.parser +import polar_sdk +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.meters.quantities(id="", start_timestamp=dateutil.parser.isoparse("2023-09-17T00:45:34.608Z"), end_timestamp=dateutil.parser.isoparse("2023-07-21T18:11:39.069Z"), interval=polar_sdk.TimeInterval.HOUR) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The meter ID. | +| `start_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Start timestamp. | +| `end_timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | End timestamp. | +| `interval` | [models.TimeInterval](../../models/timeinterval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `customer_id` | [OptionalNullable[models.MetersQuantitiesQueryParamCustomerIDFilter]](../../models/metersquantitiesqueryparamcustomeridfilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `exernal_customer_id` | [OptionalNullable[models.QueryParamExternalCustomerIDFilter]](../../models/queryparamexternalcustomeridfilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MeterQuantities](../../models/meterquantities.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| models.ResourceNotFound | 404 | application/json | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/metricssdk/README.md b/docs/sdks/metricssdk/README.md index 25194f8b..a6969ee7 100644 --- a/docs/sdks/metricssdk/README.md +++ b/docs/sdks/metricssdk/README.md @@ -23,7 +23,7 @@ with Polar( access_token="", ) as polar: - res = polar.metrics.get(start_date=dateutil.parser.parse("2025-02-06").date(), end_date=dateutil.parser.parse("2024-09-04").date(), interval=polar_sdk.Interval.WEEK) + res = polar.metrics.get(start_date=dateutil.parser.parse("2025-02-06").date(), end_date=dateutil.parser.parse("2024-09-04").date(), interval=polar_sdk.TimeInterval.WEEK) # Handle response print(res) @@ -36,7 +36,7 @@ with Polar( | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `start_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_check_mark: | Start date. | | `end_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_check_mark: | End date. | -| `interval` | [models.Interval](../../models/interval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `interval` | [models.TimeInterval](../../models/timeinterval.md) | :heavy_check_mark: | Interval between two timestamps. | | `organization_id` | [OptionalNullable[models.MetricsGetQueryParamOrganizationIDFilter]](../../models/metricsgetqueryparamorganizationidfilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `product_id` | [OptionalNullable[models.MetricsGetQueryParamProductIDFilter]](../../models/metricsgetqueryparamproductidfilter.md) | :heavy_minus_sign: | Filter by product ID. | | `product_price_type` | [OptionalNullable[models.QueryParamProductPriceTypeFilter]](../../models/queryparamproductpricetypefilter.md) | :heavy_minus_sign: | Filter by product price type. `recurring` will filter data corresponding to subscriptions creations or renewals. `one_time` will filter data corresponding to one-time purchases. | diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md index 7365290e..46c86134 100644 --- a/docs/sdks/orders/README.md +++ b/docs/sdks/orders/README.md @@ -22,7 +22,7 @@ with Polar( access_token="", ) as polar: - res = polar.orders.list(page=1, limit=10) + res = polar.orders.list() while res is not None: # Handle items diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index bc2179ec..0861edc0 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -23,7 +23,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.list(page=1, limit=10) + res = polar.organizations.list() while res is not None: # Handle items @@ -146,10 +146,7 @@ with Polar( access_token="", ) as polar: - res = polar.organizations.update(id="", organization_update={ - "pledge_badge_show_amount": False, - "pledge_minimum_amount": 2000, - }) + res = polar.organizations.update(id="", organization_update={}) # Handle response print(res) diff --git a/docs/sdks/polarlicensekeys/README.md b/docs/sdks/polarlicensekeys/README.md index 0269e4e5..c17e6c62 100644 --- a/docs/sdks/polarlicensekeys/README.md +++ b/docs/sdks/polarlicensekeys/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.customer_portal.license_keys.list(page=1, limit=10) + res = polar.customer_portal.license_keys.list() while res is not None: # Handle items diff --git a/docs/sdks/polarorders/README.md b/docs/sdks/polarorders/README.md index e75fdb4d..5726c2a2 100644 --- a/docs/sdks/polarorders/README.md +++ b/docs/sdks/polarorders/README.md @@ -22,7 +22,7 @@ with Polar( access_token="", ) as polar: - res = polar.customer_portal.orders.list(page=1, limit=10) + res = polar.customer_portal.orders.list() while res is not None: # Handle items diff --git a/docs/sdks/polarsubscriptions/README.md b/docs/sdks/polarsubscriptions/README.md index a615ba99..4116516c 100644 --- a/docs/sdks/polarsubscriptions/README.md +++ b/docs/sdks/polarsubscriptions/README.md @@ -23,7 +23,7 @@ with Polar( access_token="", ) as polar: - res = polar.customer_portal.subscriptions.list(page=1, limit=10) + res = polar.customer_portal.subscriptions.list() while res is not None: # Handle items diff --git a/docs/sdks/products/README.md b/docs/sdks/products/README.md index cacb14cf..00033dc4 100644 --- a/docs/sdks/products/README.md +++ b/docs/sdks/products/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.products.list(page=1, limit=10) + res = polar.products.list() while res is not None: # Handle items diff --git a/docs/sdks/refunds/README.md b/docs/sdks/refunds/README.md index 576851a3..ef69cc95 100644 --- a/docs/sdks/refunds/README.md +++ b/docs/sdks/refunds/README.md @@ -21,7 +21,7 @@ with Polar( access_token="", ) as polar: - res = polar.refunds.list(page=1, limit=10) + res = polar.refunds.list() while res is not None: # Handle items @@ -74,7 +74,6 @@ with Polar( "order_id": "", "reason": polar_sdk.RefundReason.CUSTOMER_REQUEST, "amount": 638424, - "revoke_benefits": False, }) assert res is not None diff --git a/docs/sdks/repositories/README.md b/docs/sdks/repositories/README.md index 04ec8f41..a0515b39 100644 --- a/docs/sdks/repositories/README.md +++ b/docs/sdks/repositories/README.md @@ -22,7 +22,7 @@ with Polar( access_token="", ) as polar: - res = polar.repositories.list(page=1, limit=10) + res = polar.repositories.list() while res is not None: # Handle items diff --git a/docs/sdks/subscriptions/README.md b/docs/sdks/subscriptions/README.md index 30a40343..d57579f8 100644 --- a/docs/sdks/subscriptions/README.md +++ b/docs/sdks/subscriptions/README.md @@ -24,7 +24,7 @@ with Polar( access_token="", ) as polar: - res = polar.subscriptions.list(page=1, limit=10) + res = polar.subscriptions.list() while res is not None: # Handle items diff --git a/pyproject.toml b/pyproject.toml index e8049511..a2758f4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "polar-sdk" -version = "0.13.4" +version = "0.13.5" description = "Polar SDK for Python" authors = [{ name = "Polar" },] readme = "README-PYPI.md" diff --git a/src/polar_sdk/_version.py b/src/polar_sdk/_version.py index b0d22e24..8b8b833f 100644 --- a/src/polar_sdk/_version.py +++ b/src/polar_sdk/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "polar-sdk" -__version__: str = "0.13.4" +__version__: str = "0.13.5" __openapi_doc_version__: str = "0.1.0" -__gen_version__: str = "2.497.8" -__user_agent__: str = "speakeasy-sdk/python 0.13.4 2.497.8 0.1.0 polar-sdk" +__gen_version__: str = "2.503.2" +__user_agent__: str = "speakeasy-sdk/python 0.13.5 2.503.2 0.1.0 polar-sdk" try: if __package__ is not None: diff --git a/src/polar_sdk/advertisements.py b/src/polar_sdk/advertisements.py index 91c94918..499ffa40 100644 --- a/src/polar_sdk/advertisements.py +++ b/src/polar_sdk/advertisements.py @@ -110,7 +110,7 @@ def next_func() -> Optional[models.AdvertisementsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AdvertisementsListResponse( result=utils.unmarshal_json( @@ -119,8 +119,10 @@ def next_func() -> Optional[models.AdvertisementsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -242,7 +244,7 @@ def next_func() -> Optional[models.AdvertisementsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AdvertisementsListResponse( result=utils.unmarshal_json( @@ -251,8 +253,10 @@ def next_func() -> Optional[models.AdvertisementsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -339,15 +343,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.AdvertisementCampaign) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -434,15 +442,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.AdvertisementCampaign) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/benefit_grants.py b/src/polar_sdk/benefit_grants.py index 1c19abec..c2a0c777 100644 --- a/src/polar_sdk/benefit_grants.py +++ b/src/polar_sdk/benefit_grants.py @@ -158,7 +158,7 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalBenefitGrantsListResponse( result=utils.unmarshal_json( @@ -167,8 +167,10 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -338,7 +340,7 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalBenefitGrantsListResponse( result=utils.unmarshal_json( @@ -347,8 +349,10 @@ def next_func() -> Optional[models.CustomerPortalBenefitGrantsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -435,15 +439,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerBenefitGrant) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -530,15 +538,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerBenefitGrant) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -640,18 +652,22 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerBenefitGrant) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -753,18 +769,22 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerBenefitGrant) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/benefits.py b/src/polar_sdk/benefits.py index 989144ef..f7b37717 100644 --- a/src/polar_sdk/benefits.py +++ b/src/polar_sdk/benefits.py @@ -117,15 +117,17 @@ def next_func() -> Optional[models.BenefitsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.BenefitsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceBenefit), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -254,15 +256,17 @@ def next_func() -> Optional[models.BenefitsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.BenefitsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceBenefit), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -352,12 +356,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Benefit) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -447,12 +453,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Benefit) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -539,15 +547,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Benefit) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -634,15 +646,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Benefit) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -744,18 +760,22 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Benefit) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -857,18 +877,22 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Benefit) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -959,18 +983,22 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1061,18 +1089,22 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -1205,7 +1237,7 @@ def next_func() -> Optional[models.BenefitsGrantsResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.BenefitsGrantsResponse( result=utils.unmarshal_json( @@ -1214,11 +1246,15 @@ def next_func() -> Optional[models.BenefitsGrantsResponse]: next=next_func, ) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1351,7 +1387,7 @@ def next_func() -> Optional[models.BenefitsGrantsResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.BenefitsGrantsResponse( result=utils.unmarshal_json( @@ -1360,11 +1396,15 @@ def next_func() -> Optional[models.BenefitsGrantsResponse]: next=next_func, ) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/checkout_links.py b/src/polar_sdk/checkout_links.py index 38c1572c..58aab738 100644 --- a/src/polar_sdk/checkout_links.py +++ b/src/polar_sdk/checkout_links.py @@ -124,7 +124,7 @@ def next_func() -> Optional[models.CheckoutLinksListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CheckoutLinksListResponse( result=utils.unmarshal_json( @@ -133,8 +133,10 @@ def next_func() -> Optional[models.CheckoutLinksListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -270,7 +272,7 @@ def next_func() -> Optional[models.CheckoutLinksListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CheckoutLinksListResponse( result=utils.unmarshal_json( @@ -279,8 +281,10 @@ def next_func() -> Optional[models.CheckoutLinksListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -370,12 +374,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLink) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -465,12 +471,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLink) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -557,15 +565,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLink) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -652,15 +664,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLink) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -761,15 +777,19 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLink) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -870,15 +890,19 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLink) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -965,15 +989,19 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1060,15 +1088,19 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/checkouts.py b/src/polar_sdk/checkouts.py index 80f94572..8f79a246 100644 --- a/src/polar_sdk/checkouts.py +++ b/src/polar_sdk/checkouts.py @@ -95,12 +95,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLegacy) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -195,12 +197,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLegacy) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -290,12 +294,14 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLegacy) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -385,12 +391,14 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutLegacy) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/clients.py b/src/polar_sdk/clients.py index 89c41e13..21d7f8a7 100644 --- a/src/polar_sdk/clients.py +++ b/src/polar_sdk/clients.py @@ -102,7 +102,7 @@ def next_func() -> Optional[models.Oauth2ClientsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.Oauth2ClientsListResponse( result=utils.unmarshal_json( @@ -111,8 +111,10 @@ def next_func() -> Optional[models.Oauth2ClientsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -226,7 +228,7 @@ def next_func() -> Optional[models.Oauth2ClientsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.Oauth2ClientsListResponse( result=utils.unmarshal_json( @@ -235,8 +237,10 @@ def next_func() -> Optional[models.Oauth2ClientsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -328,12 +332,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -425,12 +431,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -517,12 +525,14 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -609,12 +619,14 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -717,12 +729,14 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -825,12 +839,14 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -917,12 +933,14 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1009,12 +1027,14 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/custom.py b/src/polar_sdk/custom.py index 16d291c1..3eb2f28d 100644 --- a/src/polar_sdk/custom.py +++ b/src/polar_sdk/custom.py @@ -124,15 +124,17 @@ def next_func() -> Optional[models.CheckoutsCustomListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CheckoutsCustomListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceCheckout), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -268,15 +270,17 @@ def next_func() -> Optional[models.CheckoutsCustomListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CheckoutsCustomListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceCheckout), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -366,12 +370,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Checkout) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -461,12 +467,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Checkout) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -553,15 +561,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Checkout) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -648,15 +660,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Checkout) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -751,20 +767,24 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Checkout) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyActiveSubscriptionErrorData ) - raise models.AlreadyActiveSubscriptionError(data=data) + raise models.AlreadyActiveSubscriptionError(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -859,20 +879,24 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Checkout) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyActiveSubscriptionErrorData ) - raise models.AlreadyActiveSubscriptionError(data=data) + raise models.AlreadyActiveSubscriptionError(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -959,15 +983,19 @@ def client_get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutPublic) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1054,15 +1082,19 @@ async def client_get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutPublic) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -1163,20 +1195,24 @@ def client_update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutPublic) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyActiveSubscriptionErrorData ) - raise models.AlreadyActiveSubscriptionError(data=data) + raise models.AlreadyActiveSubscriptionError(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1277,20 +1313,24 @@ async def client_update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutPublic) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyActiveSubscriptionErrorData ) - raise models.AlreadyActiveSubscriptionError(data=data) + raise models.AlreadyActiveSubscriptionError(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -1393,20 +1433,24 @@ def client_confirm( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutPublicConfirmed) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyActiveSubscriptionErrorData ) - raise models.AlreadyActiveSubscriptionError(data=data) + raise models.AlreadyActiveSubscriptionError(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1509,20 +1553,24 @@ async def client_confirm_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CheckoutPublicConfirmed) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyActiveSubscriptionErrorData ) - raise models.AlreadyActiveSubscriptionError(data=data) + raise models.AlreadyActiveSubscriptionError(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/custom_fields.py b/src/polar_sdk/custom_fields.py index a19c5a29..fcfe5596 100644 --- a/src/polar_sdk/custom_fields.py +++ b/src/polar_sdk/custom_fields.py @@ -125,7 +125,7 @@ def next_func() -> Optional[models.CustomFieldsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomFieldsListResponse( result=utils.unmarshal_json( @@ -134,8 +134,10 @@ def next_func() -> Optional[models.CustomFieldsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -272,7 +274,7 @@ def next_func() -> Optional[models.CustomFieldsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomFieldsListResponse( result=utils.unmarshal_json( @@ -281,8 +283,10 @@ def next_func() -> Optional[models.CustomFieldsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -372,12 +376,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomField) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -467,12 +473,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomField) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -559,15 +567,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomField) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -654,15 +666,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomField) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -763,15 +779,19 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomField) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -872,15 +892,19 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomField) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -967,15 +991,19 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1062,15 +1090,19 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/customer_sessions.py b/src/polar_sdk/customer_sessions.py index 2a6e5ba0..242c6cc8 100644 --- a/src/polar_sdk/customer_sessions.py +++ b/src/polar_sdk/customer_sessions.py @@ -79,12 +79,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSession) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -176,12 +178,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSession) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/customers.py b/src/polar_sdk/customers.py index d4ab7fa7..b93734e4 100644 --- a/src/polar_sdk/customers.py +++ b/src/polar_sdk/customers.py @@ -132,15 +132,17 @@ def next_func() -> Optional[models.CustomersListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomersListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceCustomer), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -284,15 +286,17 @@ def next_func() -> Optional[models.CustomersListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomersListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceCustomer), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -382,12 +386,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Customer) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -477,12 +483,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Customer) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -569,15 +577,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Customer) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -664,15 +676,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Customer) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -767,15 +783,19 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Customer) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -870,15 +890,19 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Customer) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -967,15 +991,19 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1064,15 +1092,19 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/discounts.py b/src/polar_sdk/discounts.py index ef4ab88a..07a81765 100644 --- a/src/polar_sdk/discounts.py +++ b/src/polar_sdk/discounts.py @@ -119,15 +119,17 @@ def next_func() -> Optional[models.DiscountsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.DiscountsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceDiscount), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -258,15 +260,17 @@ def next_func() -> Optional[models.DiscountsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.DiscountsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceDiscount), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -356,12 +360,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Discount) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -451,12 +457,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Discount) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -543,15 +551,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Discount) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -638,15 +650,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Discount) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -741,15 +757,19 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Discount) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -844,15 +864,19 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Discount) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -939,15 +963,19 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1034,15 +1062,19 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/downloadables.py b/src/polar_sdk/downloadables.py index 4ce86e47..f51c2ca6 100644 --- a/src/polar_sdk/downloadables.py +++ b/src/polar_sdk/downloadables.py @@ -118,7 +118,7 @@ def next_func() -> Optional[models.CustomerPortalDownloadablesListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalDownloadablesListResponse( result=utils.unmarshal_json( @@ -127,8 +127,10 @@ def next_func() -> Optional[models.CustomerPortalDownloadablesListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -258,7 +260,7 @@ def next_func() -> Optional[models.CustomerPortalDownloadablesListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalDownloadablesListResponse( result=utils.unmarshal_json( @@ -267,8 +269,10 @@ def next_func() -> Optional[models.CustomerPortalDownloadablesListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -355,14 +359,16 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "302", "*"): return None if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, ["400", "404", "410", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -449,14 +455,16 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "302", "*"): return None if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, ["400", "404", "410", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/events.py b/src/polar_sdk/events.py new file mode 100644 index 00000000..b9885c1c --- /dev/null +++ b/src/polar_sdk/events.py @@ -0,0 +1,759 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from datetime import datetime +from jsonpath import JSONPath +from polar_sdk import models, utils +from polar_sdk._hooks import HookContext +from polar_sdk.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Dict, List, Mapping, Optional, Union, cast + + +class Events(BaseSDK): + def list( + self, + *, + start_timestamp: OptionalNullable[datetime] = UNSET, + end_timestamp: OptionalNullable[datetime] = UNSET, + organization_id: OptionalNullable[ + Union[ + models.EventsListQueryParamOrganizationIDFilter, + models.EventsListQueryParamOrganizationIDFilterTypedDict, + ] + ] = UNSET, + customer_id: OptionalNullable[ + Union[ + models.EventsListQueryParamCustomerIDFilter, + models.EventsListQueryParamCustomerIDFilterTypedDict, + ] + ] = UNSET, + external_customer_id: OptionalNullable[ + Union[ + models.ExternalCustomerIDFilter, + models.ExternalCustomerIDFilterTypedDict, + ] + ] = UNSET, + source: OptionalNullable[ + Union[models.SourceFilter, models.SourceFilterTypedDict] + ] = UNSET, + page: Optional[int] = 1, + limit: Optional[int] = 10, + sorting: OptionalNullable[List[models.EventSortProperty]] = UNSET, + metadata: OptionalNullable[ + Union[ + Dict[str, models.MetadataQuery], + Dict[str, models.MetadataQueryTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EventsListResponse]: + r"""List Events + + List events. + + :param start_timestamp: Filter events after this timestamp. + :param end_timestamp: Filter events before this timestamp. + :param organization_id: Filter by organization ID. + :param customer_id: Filter by customer ID. + :param external_customer_id: Filter by external customer ID. + :param source: Filter by event source. + :param page: Page number, defaults to 1. + :param limit: Size of a page, defaults to 10. Maximum is 100. + :param sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. + :param metadata: Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.EventsListRequest( + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + organization_id=organization_id, + customer_id=customer_id, + external_customer_id=external_customer_id, + source=source, + page=page, + limit=limit, + sorting=sorting, + metadata=metadata, + ) + + req = self._build_request( + method="GET", + path="/v1/events/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="events:list", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.EventsListResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.list( + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + organization_id=organization_id, + customer_id=customer_id, + external_customer_id=external_customer_id, + source=source, + page=next_page, + limit=limit, + sorting=sorting, + metadata=metadata, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.EventsListResponse( + result=utils.unmarshal_json(http_res.text, models.ListResourceEvent), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_async( + self, + *, + start_timestamp: OptionalNullable[datetime] = UNSET, + end_timestamp: OptionalNullable[datetime] = UNSET, + organization_id: OptionalNullable[ + Union[ + models.EventsListQueryParamOrganizationIDFilter, + models.EventsListQueryParamOrganizationIDFilterTypedDict, + ] + ] = UNSET, + customer_id: OptionalNullable[ + Union[ + models.EventsListQueryParamCustomerIDFilter, + models.EventsListQueryParamCustomerIDFilterTypedDict, + ] + ] = UNSET, + external_customer_id: OptionalNullable[ + Union[ + models.ExternalCustomerIDFilter, + models.ExternalCustomerIDFilterTypedDict, + ] + ] = UNSET, + source: OptionalNullable[ + Union[models.SourceFilter, models.SourceFilterTypedDict] + ] = UNSET, + page: Optional[int] = 1, + limit: Optional[int] = 10, + sorting: OptionalNullable[List[models.EventSortProperty]] = UNSET, + metadata: OptionalNullable[ + Union[ + Dict[str, models.MetadataQuery], + Dict[str, models.MetadataQueryTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EventsListResponse]: + r"""List Events + + List events. + + :param start_timestamp: Filter events after this timestamp. + :param end_timestamp: Filter events before this timestamp. + :param organization_id: Filter by organization ID. + :param customer_id: Filter by customer ID. + :param external_customer_id: Filter by external customer ID. + :param source: Filter by event source. + :param page: Page number, defaults to 1. + :param limit: Size of a page, defaults to 10. Maximum is 100. + :param sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. + :param metadata: Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.EventsListRequest( + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + organization_id=organization_id, + customer_id=customer_id, + external_customer_id=external_customer_id, + source=source, + page=page, + limit=limit, + sorting=sorting, + metadata=metadata, + ) + + req = self._build_request_async( + method="GET", + path="/v1/events/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="events:list", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.EventsListResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.list( + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + organization_id=organization_id, + customer_id=customer_id, + external_customer_id=external_customer_id, + source=source, + page=next_page, + limit=limit, + sorting=sorting, + metadata=metadata, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.EventsListResponse( + result=utils.unmarshal_json(http_res.text, models.ListResourceEvent), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Event: + r"""Get Event + + Get an event by ID. + + :param id: The event ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.EventsGetRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/v1/events/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="events:get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.Event) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Event: + r"""Get Event + + Get an event by ID. + + :param id: The event ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.EventsGetRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/events/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="events:get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.Event) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def ingest( + self, + *, + request: Union[models.EventsIngest, models.EventsIngestTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.EventsIngestResponse: + r"""Ingest Events + + Ingest batch of events. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.EventsIngest) + request = cast(models.EventsIngest, request) + + req = self._build_request( + method="POST", + path="/v1/events/ingest", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.EventsIngest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="events:ingest", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.EventsIngestResponse) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def ingest_async( + self, + *, + request: Union[models.EventsIngest, models.EventsIngestTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.EventsIngestResponse: + r"""Ingest Events + + Ingest batch of events. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.EventsIngest) + request = cast(models.EventsIngest, request) + + req = self._build_request_async( + method="POST", + path="/v1/events/ingest", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.EventsIngest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="events:ingest", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.EventsIngestResponse) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/src/polar_sdk/external_organizations.py b/src/polar_sdk/external_organizations.py index fc2c5d39..12162bcd 100644 --- a/src/polar_sdk/external_organizations.py +++ b/src/polar_sdk/external_organizations.py @@ -126,7 +126,7 @@ def next_func() -> Optional[models.ExternalOrganizationsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ExternalOrganizationsListResponse( result=utils.unmarshal_json( @@ -135,8 +135,10 @@ def next_func() -> Optional[models.ExternalOrganizationsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -274,7 +276,7 @@ def next_func() -> Optional[models.ExternalOrganizationsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ExternalOrganizationsListResponse( result=utils.unmarshal_json( @@ -283,8 +285,10 @@ def next_func() -> Optional[models.ExternalOrganizationsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/files.py b/src/polar_sdk/files.py index e0c53794..032309ac 100644 --- a/src/polar_sdk/files.py +++ b/src/polar_sdk/files.py @@ -110,15 +110,17 @@ def next_func() -> Optional[models.FilesListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FilesListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceFileRead), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -240,15 +242,17 @@ def next_func() -> Optional[models.FilesListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FilesListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceFileRead), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -338,12 +342,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.FileUpload) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -433,12 +439,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.FileUpload) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -539,20 +547,24 @@ def uploaded( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json( http_res.text, models.FilesUploadedResponseFilesUploaded ) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -653,20 +665,24 @@ async def uploaded_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json( http_res.text, models.FilesUploadedResponseFilesUploaded ) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -759,20 +775,24 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json( http_res.text, models.FilesUpdateResponseFilesUpdate ) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -865,20 +885,24 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json( http_res.text, models.FilesUpdateResponseFilesUpdate ) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -965,18 +989,22 @@ def delete( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1063,18 +1091,22 @@ async def delete_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/license_keys.py b/src/polar_sdk/license_keys.py index 7c16a1fd..25f8b4fd 100644 --- a/src/polar_sdk/license_keys.py +++ b/src/polar_sdk/license_keys.py @@ -120,7 +120,7 @@ def next_func() -> Optional[models.LicenseKeysListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.LicenseKeysListResponse( result=utils.unmarshal_json( @@ -129,14 +129,18 @@ def next_func() -> Optional[models.LicenseKeysListResponse]: next=next_func, ) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -268,7 +272,7 @@ def next_func() -> Optional[models.LicenseKeysListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.LicenseKeysListResponse( result=utils.unmarshal_json( @@ -277,14 +281,18 @@ def next_func() -> Optional[models.LicenseKeysListResponse]: next=next_func, ) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -371,18 +379,22 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyWithActivations) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -469,18 +481,22 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyWithActivations) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -581,18 +597,22 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyRead) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -693,18 +713,22 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyRead) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -794,18 +818,22 @@ def get_activation( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyActivationRead) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -895,18 +923,22 @@ async def get_activation_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyActivationRead) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/meters.py b/src/polar_sdk/meters.py new file mode 100644 index 00000000..46829800 --- /dev/null +++ b/src/polar_sdk/meters.py @@ -0,0 +1,1427 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from datetime import datetime +from jsonpath import JSONPath +from polar_sdk import models, utils +from polar_sdk._hooks import HookContext +from polar_sdk.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Dict, List, Mapping, Optional, Union, cast + + +class Meters(BaseSDK): + def list( + self, + *, + organization_id: OptionalNullable[ + Union[ + models.MetersListQueryParamOrganizationIDFilter, + models.MetersListQueryParamOrganizationIDFilterTypedDict, + ] + ] = UNSET, + query: OptionalNullable[str] = UNSET, + page: Optional[int] = 1, + limit: Optional[int] = 10, + sorting: OptionalNullable[List[models.MeterSortProperty]] = UNSET, + metadata: OptionalNullable[ + Union[ + Dict[str, models.MetadataQuery], + Dict[str, models.MetadataQueryTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.MetersListResponse]: + r"""List Meters + + List meters. + + :param organization_id: Filter by organization ID. + :param query: Filter by name. + :param page: Page number, defaults to 1. + :param limit: Size of a page, defaults to 10. Maximum is 100. + :param sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. + :param metadata: Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersListRequest( + organization_id=organization_id, + query=query, + page=page, + limit=limit, + sorting=sorting, + metadata=metadata, + ) + + req = self._build_request( + method="GET", + path="/v1/meters/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="meters:list", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.MetersListResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.list( + organization_id=organization_id, + query=query, + page=next_page, + limit=limit, + sorting=sorting, + metadata=metadata, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.MetersListResponse( + result=utils.unmarshal_json(http_res.text, models.ListResourceMeter), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_async( + self, + *, + organization_id: OptionalNullable[ + Union[ + models.MetersListQueryParamOrganizationIDFilter, + models.MetersListQueryParamOrganizationIDFilterTypedDict, + ] + ] = UNSET, + query: OptionalNullable[str] = UNSET, + page: Optional[int] = 1, + limit: Optional[int] = 10, + sorting: OptionalNullable[List[models.MeterSortProperty]] = UNSET, + metadata: OptionalNullable[ + Union[ + Dict[str, models.MetadataQuery], + Dict[str, models.MetadataQueryTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.MetersListResponse]: + r"""List Meters + + List meters. + + :param organization_id: Filter by organization ID. + :param query: Filter by name. + :param page: Page number, defaults to 1. + :param limit: Size of a page, defaults to 10. Maximum is 100. + :param sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. + :param metadata: Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersListRequest( + organization_id=organization_id, + query=query, + page=page, + limit=limit, + sorting=sorting, + metadata=metadata, + ) + + req = self._build_request_async( + method="GET", + path="/v1/meters/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="meters:list", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.MetersListResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.list( + organization_id=organization_id, + query=query, + page=next_page, + limit=limit, + sorting=sorting, + metadata=metadata, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.MetersListResponse( + result=utils.unmarshal_json(http_res.text, models.ListResourceMeter), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def create( + self, + *, + request: Union[models.MeterCreate, models.MeterCreateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Meter: + r"""Create Meter + + Create a meter. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.MeterCreate) + request = cast(models.MeterCreate, request) + + req = self._build_request( + method="POST", + path="/v1/meters/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.MeterCreate + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="meters:create", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return utils.unmarshal_json(http_res.text, models.Meter) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_async( + self, + *, + request: Union[models.MeterCreate, models.MeterCreateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Meter: + r"""Create Meter + + Create a meter. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, models.MeterCreate) + request = cast(models.MeterCreate, request) + + req = self._build_request_async( + method="POST", + path="/v1/meters/", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.MeterCreate + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="meters:create", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return utils.unmarshal_json(http_res.text, models.Meter) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Meter: + r"""Get Meter + + Get a meter by ID. + + :param id: The meter ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersGetRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/v1/meters/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="meters:get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.Meter) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Meter: + r"""Get Meter + + Get a meter by ID. + + :param id: The meter ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersGetRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/meters/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="meters:get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.Meter) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def update( + self, + *, + id: str, + meter_update: Union[models.MeterUpdate, models.MeterUpdateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Meter: + r"""Update Meter + + Update a meter. + + :param id: The meter ID. + :param meter_update: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersUpdateRequest( + id=id, + meter_update=utils.get_pydantic_model(meter_update, models.MeterUpdate), + ) + + req = self._build_request( + method="PATCH", + path="/v1/meters/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.meter_update, False, False, "json", models.MeterUpdate + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="meters:update", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.Meter) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def update_async( + self, + *, + id: str, + meter_update: Union[models.MeterUpdate, models.MeterUpdateTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Meter: + r"""Update Meter + + Update a meter. + + :param id: The meter ID. + :param meter_update: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersUpdateRequest( + id=id, + meter_update=utils.get_pydantic_model(meter_update, models.MeterUpdate), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/meters/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.meter_update, False, False, "json", models.MeterUpdate + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="meters:update", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.Meter) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def events( + self, + *, + id: str, + page: Optional[int] = 1, + limit: Optional[int] = 10, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.MetersEventsResponse]: + r"""Get Meter Events + + Get events matching the filter of a meter. + + :param id: The meter ID. + :param page: Page number, defaults to 1. + :param limit: Size of a page, defaults to 10. Maximum is 100. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersEventsRequest( + id=id, + page=page, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/v1/meters/{id}/events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="meters:events", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.MetersEventsResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.events( + id=id, + page=next_page, + limit=limit, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.MetersEventsResponse( + result=utils.unmarshal_json(http_res.text, models.ListResourceEvent), + next=next_func, + ) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def events_async( + self, + *, + id: str, + page: Optional[int] = 1, + limit: Optional[int] = 10, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.MetersEventsResponse]: + r"""Get Meter Events + + Get events matching the filter of a meter. + + :param id: The meter ID. + :param page: Page number, defaults to 1. + :param limit: Size of a page, defaults to 10. Maximum is 100. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersEventsRequest( + id=id, + page=page, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/v1/meters/{id}/events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="meters:events", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.MetersEventsResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + page = request.page if not request.page is None else 1 + next_page = page + 1 + + num_pages = JSONPath("$.pagination.max_page").parse(body) + if len(num_pages) == 0 or num_pages[0] <= page: + return None + + if not http_res.text: + return None + results = JSONPath("$.items").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if not request.limit is None else 10 + if len(results[0]) < limit: + return None + + return self.events( + id=id, + page=next_page, + limit=limit, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.MetersEventsResponse( + result=utils.unmarshal_json(http_res.text, models.ListResourceEvent), + next=next_func, + ) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def quantities( + self, + *, + id: str, + start_timestamp: datetime, + end_timestamp: datetime, + interval: models.TimeInterval, + customer_id: OptionalNullable[ + Union[ + models.MetersQuantitiesQueryParamCustomerIDFilter, + models.MetersQuantitiesQueryParamCustomerIDFilterTypedDict, + ] + ] = UNSET, + exernal_customer_id: OptionalNullable[ + Union[ + models.QueryParamExternalCustomerIDFilter, + models.QueryParamExternalCustomerIDFilterTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MeterQuantities: + r"""Get Meter Quantities + + Get quantities of a meter over a time period. + + :param id: The meter ID. + :param start_timestamp: Start timestamp. + :param end_timestamp: End timestamp. + :param interval: Interval between two timestamps. + :param customer_id: Filter by customer ID. + :param exernal_customer_id: Filter by external customer ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersQuantitiesRequest( + id=id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + interval=interval, + customer_id=customer_id, + exernal_customer_id=exernal_customer_id, + ) + + req = self._build_request( + method="GET", + path="/v1/meters/{id}/quantities", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="meters:quantities", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.MeterQuantities) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def quantities_async( + self, + *, + id: str, + start_timestamp: datetime, + end_timestamp: datetime, + interval: models.TimeInterval, + customer_id: OptionalNullable[ + Union[ + models.MetersQuantitiesQueryParamCustomerIDFilter, + models.MetersQuantitiesQueryParamCustomerIDFilterTypedDict, + ] + ] = UNSET, + exernal_customer_id: OptionalNullable[ + Union[ + models.QueryParamExternalCustomerIDFilter, + models.QueryParamExternalCustomerIDFilterTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MeterQuantities: + r"""Get Meter Quantities + + Get quantities of a meter over a time period. + + :param id: The meter ID. + :param start_timestamp: Start timestamp. + :param end_timestamp: End timestamp. + :param interval: Interval between two timestamps. + :param customer_id: Filter by customer ID. + :param exernal_customer_id: Filter by external customer ID. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.MetersQuantitiesRequest( + id=id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + interval=interval, + customer_id=customer_id, + exernal_customer_id=exernal_customer_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/meters/{id}/quantities", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="meters:quantities", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.MeterQuantities) + if utils.match_response(http_res, "404", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/src/polar_sdk/metrics_sdk.py b/src/polar_sdk/metrics_sdk.py index f06b476f..4a158f7d 100644 --- a/src/polar_sdk/metrics_sdk.py +++ b/src/polar_sdk/metrics_sdk.py @@ -14,7 +14,7 @@ def get( *, start_date: date, end_date: date, - interval: models.Interval, + interval: models.TimeInterval, organization_id: OptionalNullable[ Union[ models.MetricsGetQueryParamOrganizationIDFilter, @@ -113,12 +113,14 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.MetricsResponse) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -144,7 +146,7 @@ async def get_async( *, start_date: date, end_date: date, - interval: models.Interval, + interval: models.TimeInterval, organization_id: OptionalNullable[ Union[ models.MetricsGetQueryParamOrganizationIDFilter, @@ -243,12 +245,14 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.MetricsResponse) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/models/__init__.py b/src/polar_sdk/models/__init__.py index 7ab262e4..91a82d70 100644 --- a/src/polar_sdk/models/__init__.py +++ b/src/polar_sdk/models/__init__.py @@ -414,6 +414,7 @@ CheckoutUpdatePublicCustomFieldDataTypedDict, CheckoutUpdatePublicTypedDict, ) +from .countaggregation import CountAggregation, CountAggregationTypedDict from .currencyamount import CurrencyAmount, CurrencyAmountTypedDict from .custom_fields_deleteop import ( CustomFieldsDeleteRequest, @@ -644,8 +645,26 @@ CustomersListRequestTypedDict, CustomersListResponse, CustomersListResponseTypedDict, + EventsListQueryParamCustomerIDFilter, + EventsListQueryParamCustomerIDFilterTypedDict, + EventsListQueryParamOrganizationIDFilter, + EventsListQueryParamOrganizationIDFilterTypedDict, + EventsListRequest, + EventsListRequestTypedDict, + EventsListResponse, + EventsListResponseTypedDict, + ExternalCustomerIDFilter, + ExternalCustomerIDFilterTypedDict, MetadataQuery, MetadataQueryTypedDict, + MetersListQueryParamOrganizationIDFilter, + MetersListQueryParamOrganizationIDFilterTypedDict, + MetersListRequest, + MetersListRequestTypedDict, + MetersListResponse, + MetersListResponseTypedDict, + SourceFilter, + SourceFilterTypedDict, ) from .customers_updateop import CustomersUpdateRequest, CustomersUpdateRequestTypedDict from .customersession import CustomerSession, CustomerSessionTypedDict @@ -897,6 +916,29 @@ ) from .downloadablefileread import DownloadableFileRead, DownloadableFileReadTypedDict from .downloadableread import DownloadableRead, DownloadableReadTypedDict +from .event import Event, EventMetadata, EventMetadataTypedDict, EventTypedDict +from .eventcreatecustomer import ( + EventCreateCustomer, + EventCreateCustomerMetadata, + EventCreateCustomerMetadataTypedDict, + EventCreateCustomerTypedDict, +) +from .eventcreateexternalcustomer import ( + EventCreateExternalCustomer, + EventCreateExternalCustomerMetadata, + EventCreateExternalCustomerMetadataTypedDict, + EventCreateExternalCustomerTypedDict, +) +from .events_getop import EventsGetRequest, EventsGetRequestTypedDict +from .eventsingest import ( + EventsIngest, + EventsIngestTypedDict, + EventsModel, + EventsModelTypedDict, +) +from .eventsingestresponse import EventsIngestResponse, EventsIngestResponseTypedDict +from .eventsortproperty import EventSortProperty +from .eventsource import EventSource from .existingproductprice import ExistingProductPrice, ExistingProductPriceTypedDict from .external_organizations_listop import ( ExternalOrganizationsListRequest, @@ -937,9 +979,12 @@ from .fileservicetypes import FileServiceTypes from .fileupload import FileUpload, FileUploadTypedDict from .fileuploadcompleted import FileUploadCompleted, FileUploadCompletedTypedDict +from .filter_ import Clauses, ClausesTypedDict, Filter, FilterTypedDict +from .filterclause import FilterClause, FilterClauseTypedDict, Value, ValueTypedDict +from .filterconjunction import FilterConjunction +from .filteroperator import FilterOperator from .funding import Funding, FundingTypedDict from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData -from .interval import Interval from .introspecttokenresponse import ( IntrospectTokenResponse, IntrospectTokenResponseTypedDict, @@ -1041,6 +1086,7 @@ ListResourceDownloadableRead, ListResourceDownloadableReadTypedDict, ) +from .listresource_event_ import ListResourceEvent, ListResourceEventTypedDict from .listresource_externalorganization_ import ( ListResourceExternalOrganization, ListResourceExternalOrganizationTypedDict, @@ -1055,6 +1101,7 @@ ListResourceLicenseKeyRead, ListResourceLicenseKeyReadTypedDict, ) +from .listresource_meter_ import ListResourceMeter, ListResourceMeterTypedDict from .listresource_oauth2client_ import ( ListResourceOAuth2Client, ListResourceOAuth2ClientTypedDict, @@ -1074,6 +1121,49 @@ ListResourceSubscription, ListResourceSubscriptionTypedDict, ) +from .meter import ( + Meter, + MeterAggregation, + MeterAggregationTypedDict, + MeterMetadata, + MeterMetadataTypedDict, + MeterTypedDict, +) +from .metercreate import ( + MeterCreate, + MeterCreateAggregation, + MeterCreateAggregationTypedDict, + MeterCreateMetadata, + MeterCreateMetadataTypedDict, + MeterCreateTypedDict, +) +from .meterquantities import MeterQuantities, MeterQuantitiesTypedDict +from .meterquantity import MeterQuantity, MeterQuantityTypedDict +from .meters_eventsop import ( + MetersEventsRequest, + MetersEventsRequestTypedDict, + MetersEventsResponse, + MetersEventsResponseTypedDict, +) +from .meters_getop import MetersGetRequest, MetersGetRequestTypedDict +from .meters_quantitiesop import ( + MetersQuantitiesQueryParamCustomerIDFilter, + MetersQuantitiesQueryParamCustomerIDFilterTypedDict, + MetersQuantitiesRequest, + MetersQuantitiesRequestTypedDict, + QueryParamExternalCustomerIDFilter, + QueryParamExternalCustomerIDFilterTypedDict, +) +from .meters_updateop import MetersUpdateRequest, MetersUpdateRequestTypedDict +from .metersortproperty import MeterSortProperty +from .meterupdate import ( + Aggregation, + AggregationTypedDict, + MeterUpdate, + MeterUpdateMetadata, + MeterUpdateMetadataTypedDict, + MeterUpdateTypedDict, +) from .metric import Metric, MetricTypedDict from .metricperiod import MetricPeriod, MetricPeriodTypedDict from .metrics import Metrics, MetricsTypedDict @@ -1365,6 +1455,7 @@ ProductUpdatePricesTypedDict, ProductUpdateTypedDict, ) +from .propertyaggregation import Func, PropertyAggregation, PropertyAggregationTypedDict from .reactions import Reactions, ReactionsTypedDict from .refund import Refund, RefundMetadata, RefundMetadataTypedDict, RefundTypedDict from .refundamounttoohigh import RefundAmountTooHigh, RefundAmountTooHighData @@ -1502,6 +1593,7 @@ from .subscriptionuser import SubscriptionUser, SubscriptionUserTypedDict from .subtype import SubType from .taxidformat import TaxIDFormat +from .timeinterval import TimeInterval from .tokenresponse import TokenResponse, TokenResponseTypedDict from .unauthorized import Unauthorized, UnauthorizedData from .userinfoorganization import UserInfoOrganization, UserInfoOrganizationTypedDict @@ -1617,6 +1709,8 @@ "AdvertisementsListRequestTypedDict", "AdvertisementsListResponse", "AdvertisementsListResponseTypedDict", + "Aggregation", + "AggregationTypedDict", "AlreadyActiveSubscriptionError", "AlreadyActiveSubscriptionErrorData", "AlreadyCanceledSubscription", @@ -1899,8 +1993,12 @@ "CheckoutsCustomUpdateRequestTypedDict", "CheckoutsGetRequest", "CheckoutsGetRequestTypedDict", + "Clauses", + "ClausesTypedDict", "Conditions", "ConditionsTypedDict", + "CountAggregation", + "CountAggregationTypedDict", "CurrencyAmount", "CurrencyAmountTypedDict", "CustomField", @@ -2243,8 +2341,40 @@ "DownloadableFileReadTypedDict", "DownloadableRead", "DownloadableReadTypedDict", + "Event", + "EventCreateCustomer", + "EventCreateCustomerMetadata", + "EventCreateCustomerMetadataTypedDict", + "EventCreateCustomerTypedDict", + "EventCreateExternalCustomer", + "EventCreateExternalCustomerMetadata", + "EventCreateExternalCustomerMetadataTypedDict", + "EventCreateExternalCustomerTypedDict", + "EventMetadata", + "EventMetadataTypedDict", + "EventSortProperty", + "EventSource", + "EventTypedDict", + "EventsGetRequest", + "EventsGetRequestTypedDict", + "EventsIngest", + "EventsIngestResponse", + "EventsIngestResponseTypedDict", + "EventsIngestTypedDict", + "EventsListQueryParamCustomerIDFilter", + "EventsListQueryParamCustomerIDFilterTypedDict", + "EventsListQueryParamOrganizationIDFilter", + "EventsListQueryParamOrganizationIDFilterTypedDict", + "EventsListRequest", + "EventsListRequestTypedDict", + "EventsListResponse", + "EventsListResponseTypedDict", + "EventsModel", + "EventsModelTypedDict", "ExistingProductPrice", "ExistingProductPriceTypedDict", + "ExternalCustomerIDFilter", + "ExternalCustomerIDFilterTypedDict", "ExternalOrganization", "ExternalOrganizationNameFilter", "ExternalOrganizationNameFilterTypedDict", @@ -2281,12 +2411,18 @@ "FilesUploadedRequestTypedDict", "FilesUploadedResponseFilesUploaded", "FilesUploadedResponseFilesUploadedTypedDict", + "Filter", + "FilterClause", + "FilterClauseTypedDict", + "FilterConjunction", + "FilterOperator", + "FilterTypedDict", + "Func", "Funding", "FundingTypedDict", "GrantTypes", "HTTPValidationError", "HTTPValidationErrorData", - "Interval", "IntrospectTokenResponse", "IntrospectTokenResponseTypedDict", "Issue", @@ -2358,12 +2494,16 @@ "ListResourceDiscountTypedDict", "ListResourceDownloadableRead", "ListResourceDownloadableReadTypedDict", + "ListResourceEvent", + "ListResourceEventTypedDict", "ListResourceExternalOrganization", "ListResourceExternalOrganizationTypedDict", "ListResourceFileRead", "ListResourceFileReadTypedDict", "ListResourceLicenseKeyRead", "ListResourceLicenseKeyReadTypedDict", + "ListResourceMeter", + "ListResourceMeterTypedDict", "ListResourceOAuth2Client", "ListResourceOAuth2ClientTypedDict", "ListResourceOrder", @@ -2386,6 +2526,45 @@ "MetadataQuery", "MetadataQueryTypedDict", "MetadataTypedDict", + "Meter", + "MeterAggregation", + "MeterAggregationTypedDict", + "MeterCreate", + "MeterCreateAggregation", + "MeterCreateAggregationTypedDict", + "MeterCreateMetadata", + "MeterCreateMetadataTypedDict", + "MeterCreateTypedDict", + "MeterMetadata", + "MeterMetadataTypedDict", + "MeterQuantities", + "MeterQuantitiesTypedDict", + "MeterQuantity", + "MeterQuantityTypedDict", + "MeterSortProperty", + "MeterTypedDict", + "MeterUpdate", + "MeterUpdateMetadata", + "MeterUpdateMetadataTypedDict", + "MeterUpdateTypedDict", + "MetersEventsRequest", + "MetersEventsRequestTypedDict", + "MetersEventsResponse", + "MetersEventsResponseTypedDict", + "MetersGetRequest", + "MetersGetRequestTypedDict", + "MetersListQueryParamOrganizationIDFilter", + "MetersListQueryParamOrganizationIDFilterTypedDict", + "MetersListRequest", + "MetersListRequestTypedDict", + "MetersListResponse", + "MetersListResponseTypedDict", + "MetersQuantitiesQueryParamCustomerIDFilter", + "MetersQuantitiesQueryParamCustomerIDFilterTypedDict", + "MetersQuantitiesRequest", + "MetersQuantitiesRequestTypedDict", + "MetersUpdateRequest", + "MetersUpdateRequestTypedDict", "Metric", "MetricPeriod", "MetricPeriodTypedDict", @@ -2614,6 +2793,8 @@ "ProductsUpdateRequestTypedDict", "Properties", "PropertiesTypedDict", + "PropertyAggregation", + "PropertyAggregationTypedDict", "QueryParamBenefitIDFilter", "QueryParamBenefitIDFilterTypedDict", "QueryParamBenefitTypeFilter", @@ -2622,6 +2803,8 @@ "QueryParamCustomerIDFilterTypedDict", "QueryParamDiscountIDFilter", "QueryParamDiscountIDFilterTypedDict", + "QueryParamExternalCustomerIDFilter", + "QueryParamExternalCustomerIDFilterTypedDict", "QueryParamOrderIDFilter", "QueryParamOrderIDFilterTypedDict", "QueryParamOrganizationIDFilter", @@ -2702,6 +2885,8 @@ "Scope", "Security", "SecurityTypedDict", + "SourceFilter", + "SourceFilterTypedDict", "State", "SubType", "Subscription", @@ -2743,6 +2928,7 @@ "TaxID", "TaxIDFormat", "TaxIDTypedDict", + "TimeInterval", "Timeframe", "TokenEndpointAuthMethod", "TokenResponse", @@ -2759,6 +2945,8 @@ "ValidatedLicenseKeyTypedDict", "ValidationError", "ValidationErrorTypedDict", + "Value", + "ValueTypedDict", "WebhookBenefitCreatedPayload", "WebhookBenefitCreatedPayloadTypedDict", "WebhookBenefitGrantCreatedPayload", diff --git a/src/polar_sdk/models/countaggregation.py b/src/polar_sdk/models/countaggregation.py new file mode 100644 index 00000000..b7e7b783 --- /dev/null +++ b/src/polar_sdk/models/countaggregation.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from polar_sdk.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class CountAggregationTypedDict(TypedDict): + func: Literal["count"] + + +class CountAggregation(BaseModel): + FUNC: Annotated[ + Annotated[Optional[Literal["count"]], AfterValidator(validate_const("count"))], + pydantic.Field(alias="func"), + ] = "count" diff --git a/src/polar_sdk/models/customers_listop.py b/src/polar_sdk/models/customers_listop.py index 6f498353..94780954 100644 --- a/src/polar_sdk/models/customers_listop.py +++ b/src/polar_sdk/models/customers_listop.py @@ -2,7 +2,13 @@ from __future__ import annotations from .customersortproperty import CustomerSortProperty +from .eventsortproperty import EventSortProperty +from .eventsource import EventSource from .listresource_customer_ import ListResourceCustomer, ListResourceCustomerTypedDict +from .listresource_event_ import ListResourceEvent, ListResourceEventTypedDict +from .listresource_meter_ import ListResourceMeter, ListResourceMeterTypedDict +from .metersortproperty import MeterSortProperty +from datetime import datetime from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from polar_sdk.utils import FieldMetadata, QueryParamMetadata from pydantic import model_serializer @@ -141,3 +147,310 @@ class CustomersListResponse(BaseModel): next: Callable[[], Optional[CustomersListResponse]] result: ListResourceCustomer + + +EventsListQueryParamOrganizationIDFilterTypedDict = TypeAliasType( + "EventsListQueryParamOrganizationIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +EventsListQueryParamOrganizationIDFilter = TypeAliasType( + "EventsListQueryParamOrganizationIDFilter", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +EventsListQueryParamCustomerIDFilterTypedDict = TypeAliasType( + "EventsListQueryParamCustomerIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + +EventsListQueryParamCustomerIDFilter = TypeAliasType( + "EventsListQueryParamCustomerIDFilter", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + +ExternalCustomerIDFilterTypedDict = TypeAliasType( + "ExternalCustomerIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by external customer ID.""" + + +ExternalCustomerIDFilter = TypeAliasType( + "ExternalCustomerIDFilter", Union[str, List[str]] +) +r"""Filter by external customer ID.""" + + +SourceFilterTypedDict = TypeAliasType( + "SourceFilterTypedDict", Union[EventSource, List[EventSource]] +) +r"""Filter by event source.""" + + +SourceFilter = TypeAliasType("SourceFilter", Union[EventSource, List[EventSource]]) +r"""Filter by event source.""" + + +class EventsListRequestTypedDict(TypedDict): + start_timestamp: NotRequired[Nullable[datetime]] + r"""Filter events after this timestamp.""" + end_timestamp: NotRequired[Nullable[datetime]] + r"""Filter events before this timestamp.""" + organization_id: NotRequired[ + Nullable[EventsListQueryParamOrganizationIDFilterTypedDict] + ] + r"""Filter by organization ID.""" + customer_id: NotRequired[Nullable[EventsListQueryParamCustomerIDFilterTypedDict]] + r"""Filter by customer ID.""" + external_customer_id: NotRequired[Nullable[ExternalCustomerIDFilterTypedDict]] + r"""Filter by external customer ID.""" + source: NotRequired[Nullable[SourceFilterTypedDict]] + r"""Filter by event source.""" + page: NotRequired[int] + r"""Page number, defaults to 1.""" + limit: NotRequired[int] + r"""Size of a page, defaults to 10. Maximum is 100.""" + sorting: NotRequired[Nullable[List[EventSortProperty]]] + r"""Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.""" + metadata: NotRequired[Nullable[Dict[str, MetadataQueryTypedDict]]] + r"""Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`.""" + + +class EventsListRequest(BaseModel): + start_timestamp: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter events after this timestamp.""" + + end_timestamp: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter events before this timestamp.""" + + organization_id: Annotated[ + OptionalNullable[EventsListQueryParamOrganizationIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by organization ID.""" + + customer_id: Annotated[ + OptionalNullable[EventsListQueryParamCustomerIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by customer ID.""" + + external_customer_id: Annotated[ + OptionalNullable[ExternalCustomerIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by external customer ID.""" + + source: Annotated[ + OptionalNullable[SourceFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by event source.""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number, defaults to 1.""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 10 + r"""Size of a page, defaults to 10. Maximum is 100.""" + + sorting: Annotated[ + OptionalNullable[List[EventSortProperty]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.""" + + metadata: Annotated[ + OptionalNullable[Dict[str, MetadataQuery]], + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = UNSET + r"""Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "start_timestamp", + "end_timestamp", + "organization_id", + "customer_id", + "external_customer_id", + "source", + "page", + "limit", + "sorting", + "metadata", + ] + nullable_fields = [ + "start_timestamp", + "end_timestamp", + "organization_id", + "customer_id", + "external_customer_id", + "source", + "sorting", + "metadata", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class EventsListResponseTypedDict(TypedDict): + result: ListResourceEventTypedDict + + +class EventsListResponse(BaseModel): + next: Callable[[], Optional[EventsListResponse]] + + result: ListResourceEvent + + +MetersListQueryParamOrganizationIDFilterTypedDict = TypeAliasType( + "MetersListQueryParamOrganizationIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +MetersListQueryParamOrganizationIDFilter = TypeAliasType( + "MetersListQueryParamOrganizationIDFilter", Union[str, List[str]] +) +r"""Filter by organization ID.""" + + +class MetersListRequestTypedDict(TypedDict): + organization_id: NotRequired[ + Nullable[MetersListQueryParamOrganizationIDFilterTypedDict] + ] + r"""Filter by organization ID.""" + query: NotRequired[Nullable[str]] + r"""Filter by name.""" + page: NotRequired[int] + r"""Page number, defaults to 1.""" + limit: NotRequired[int] + r"""Size of a page, defaults to 10. Maximum is 100.""" + sorting: NotRequired[Nullable[List[MeterSortProperty]]] + r"""Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.""" + metadata: NotRequired[Nullable[Dict[str, MetadataQueryTypedDict]]] + r"""Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`.""" + + +class MetersListRequest(BaseModel): + organization_id: Annotated[ + OptionalNullable[MetersListQueryParamOrganizationIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by organization ID.""" + + query: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by name.""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number, defaults to 1.""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 10 + r"""Size of a page, defaults to 10. Maximum is 100.""" + + sorting: Annotated[ + OptionalNullable[List[MeterSortProperty]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.""" + + metadata: Annotated[ + OptionalNullable[Dict[str, MetadataQuery]], + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = UNSET + r"""Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "organization_id", + "query", + "page", + "limit", + "sorting", + "metadata", + ] + nullable_fields = ["organization_id", "query", "sorting", "metadata"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class MetersListResponseTypedDict(TypedDict): + result: ListResourceMeterTypedDict + + +class MetersListResponse(BaseModel): + next: Callable[[], Optional[MetersListResponse]] + + result: ListResourceMeter diff --git a/src/polar_sdk/models/event.py b/src/polar_sdk/models/event.py new file mode 100644 index 00000000..8b526cea --- /dev/null +++ b/src/polar_sdk/models/event.py @@ -0,0 +1,86 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .eventsource import EventSource +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Union +from typing_extensions import TypeAliasType, TypedDict + + +EventMetadataTypedDict = TypeAliasType("EventMetadataTypedDict", Union[str, int, bool]) + + +EventMetadata = TypeAliasType("EventMetadata", Union[str, int, bool]) + + +class EventTypedDict(TypedDict): + metadata: Dict[str, EventMetadataTypedDict] + id: str + r"""The ID of the object.""" + timestamp: datetime + r"""The timestamp of the event.""" + name: str + r"""The name of the event.""" + source: EventSource + organization_id: str + r"""The ID of the organization owning the event.""" + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + + +class Event(BaseModel): + metadata: Dict[str, EventMetadata] + + id: str + r"""The ID of the object.""" + + timestamp: datetime + r"""The timestamp of the event.""" + + name: str + r"""The name of the event.""" + + source: EventSource + + organization_id: str + r"""The ID of the organization owning the event.""" + + customer_id: Nullable[str] + r"""ID of the customer in your Polar organization associated with the event.""" + + external_customer_id: Nullable[str] + r"""ID of the customer in your system associated with the event.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["customer_id", "external_customer_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/eventcreatecustomer.py b/src/polar_sdk/models/eventcreatecustomer.py new file mode 100644 index 00000000..17b079c0 --- /dev/null +++ b/src/polar_sdk/models/eventcreatecustomer.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +EventCreateCustomerMetadataTypedDict = TypeAliasType( + "EventCreateCustomerMetadataTypedDict", Union[str, int, bool] +) + + +EventCreateCustomerMetadata = TypeAliasType( + "EventCreateCustomerMetadata", Union[str, int, bool] +) + + +class EventCreateCustomerTypedDict(TypedDict): + name: str + r"""The name of the event.""" + customer_id: str + r"""ID of the customer in your Polar organization associated with the event.""" + metadata: NotRequired[Dict[str, EventCreateCustomerMetadataTypedDict]] + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A boolean + + You can store up to **50 key-value pairs**. + """ + timestamp: NotRequired[datetime] + r"""The timestamp of the event.""" + organization_id: NotRequired[Nullable[str]] + r"""The ID of the organization owning the event. **Required unless you use an organization token.**""" + + +class EventCreateCustomer(BaseModel): + name: str + r"""The name of the event.""" + + customer_id: str + r"""ID of the customer in your Polar organization associated with the event.""" + + metadata: Optional[Dict[str, EventCreateCustomerMetadata]] = None + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A boolean + + You can store up to **50 key-value pairs**. + """ + + timestamp: Optional[datetime] = None + r"""The timestamp of the event.""" + + organization_id: OptionalNullable[str] = UNSET + r"""The ID of the organization owning the event. **Required unless you use an organization token.**""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["metadata", "timestamp", "organization_id"] + nullable_fields = ["organization_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/eventcreateexternalcustomer.py b/src/polar_sdk/models/eventcreateexternalcustomer.py new file mode 100644 index 00000000..40910dbe --- /dev/null +++ b/src/polar_sdk/models/eventcreateexternalcustomer.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +EventCreateExternalCustomerMetadataTypedDict = TypeAliasType( + "EventCreateExternalCustomerMetadataTypedDict", Union[str, int, bool] +) + + +EventCreateExternalCustomerMetadata = TypeAliasType( + "EventCreateExternalCustomerMetadata", Union[str, int, bool] +) + + +class EventCreateExternalCustomerTypedDict(TypedDict): + name: str + r"""The name of the event.""" + external_customer_id: str + r"""ID of the customer in your system associated with the event.""" + metadata: NotRequired[Dict[str, EventCreateExternalCustomerMetadataTypedDict]] + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A boolean + + You can store up to **50 key-value pairs**. + """ + timestamp: NotRequired[datetime] + r"""The timestamp of the event.""" + organization_id: NotRequired[Nullable[str]] + r"""The ID of the organization owning the event. **Required unless you use an organization token.**""" + + +class EventCreateExternalCustomer(BaseModel): + name: str + r"""The name of the event.""" + + external_customer_id: str + r"""ID of the customer in your system associated with the event.""" + + metadata: Optional[Dict[str, EventCreateExternalCustomerMetadata]] = None + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A boolean + + You can store up to **50 key-value pairs**. + """ + + timestamp: Optional[datetime] = None + r"""The timestamp of the event.""" + + organization_id: OptionalNullable[str] = UNSET + r"""The ID of the organization owning the event. **Required unless you use an organization token.**""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["metadata", "timestamp", "organization_id"] + nullable_fields = ["organization_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/events_getop.py b/src/polar_sdk/models/events_getop.py new file mode 100644 index 00000000..c231a3af --- /dev/null +++ b/src/polar_sdk/models/events_getop.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from polar_sdk.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class EventsGetRequestTypedDict(TypedDict): + id: str + r"""The event ID.""" + + +class EventsGetRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The event ID.""" diff --git a/src/polar_sdk/models/eventsingest.py b/src/polar_sdk/models/eventsingest.py new file mode 100644 index 00000000..130d636a --- /dev/null +++ b/src/polar_sdk/models/eventsingest.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .eventcreatecustomer import EventCreateCustomer, EventCreateCustomerTypedDict +from .eventcreateexternalcustomer import ( + EventCreateExternalCustomer, + EventCreateExternalCustomerTypedDict, +) +from polar_sdk.types import BaseModel +from typing import List, Union +from typing_extensions import TypeAliasType, TypedDict + + +EventsModelTypedDict = TypeAliasType( + "EventsModelTypedDict", + Union[EventCreateCustomerTypedDict, EventCreateExternalCustomerTypedDict], +) + + +EventsModel = TypeAliasType( + "EventsModel", Union[EventCreateCustomer, EventCreateExternalCustomer] +) + + +class EventsIngestTypedDict(TypedDict): + events: List[EventsModelTypedDict] + r"""List of events to ingest.""" + + +class EventsIngest(BaseModel): + events: List[EventsModel] + r"""List of events to ingest.""" diff --git a/src/polar_sdk/models/eventsingestresponse.py b/src/polar_sdk/models/eventsingestresponse.py new file mode 100644 index 00000000..bc19e3dd --- /dev/null +++ b/src/polar_sdk/models/eventsingestresponse.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from typing_extensions import TypedDict + + +class EventsIngestResponseTypedDict(TypedDict): + inserted: int + r"""Number of events inserted.""" + + +class EventsIngestResponse(BaseModel): + inserted: int + r"""Number of events inserted.""" diff --git a/src/polar_sdk/models/eventsortproperty.py b/src/polar_sdk/models/eventsortproperty.py new file mode 100644 index 00000000..b5c2841d --- /dev/null +++ b/src/polar_sdk/models/eventsortproperty.py @@ -0,0 +1,9 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class EventSortProperty(str, Enum): + TIMESTAMP = "timestamp" + MINUS_TIMESTAMP = "-timestamp" diff --git a/src/polar_sdk/models/eventsource.py b/src/polar_sdk/models/eventsource.py new file mode 100644 index 00000000..151f4298 --- /dev/null +++ b/src/polar_sdk/models/eventsource.py @@ -0,0 +1,9 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class EventSource(str, Enum): + SYSTEM = "system" + USER = "user" diff --git a/src/polar_sdk/models/filter_.py b/src/polar_sdk/models/filter_.py new file mode 100644 index 00000000..50f173ec --- /dev/null +++ b/src/polar_sdk/models/filter_.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .filterclause import FilterClause, FilterClauseTypedDict +from .filterconjunction import FilterConjunction +from polar_sdk.types import BaseModel +from typing import List, Union +from typing_extensions import TypeAliasType, TypedDict + + +class FilterTypedDict(TypedDict): + conjunction: FilterConjunction + clauses: List[ClausesTypedDict] + + +class Filter(BaseModel): + conjunction: FilterConjunction + + clauses: List[Clauses] + + +ClausesTypedDict = TypeAliasType( + "ClausesTypedDict", Union[FilterTypedDict, FilterClauseTypedDict] +) + + +Clauses = TypeAliasType("Clauses", Union[Filter, FilterClause]) diff --git a/src/polar_sdk/models/filterclause.py b/src/polar_sdk/models/filterclause.py new file mode 100644 index 00000000..d8addb94 --- /dev/null +++ b/src/polar_sdk/models/filterclause.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .filteroperator import FilterOperator +from polar_sdk.types import BaseModel +from typing import Union +from typing_extensions import TypeAliasType, TypedDict + + +ValueTypedDict = TypeAliasType("ValueTypedDict", Union[str, int, bool]) + + +Value = TypeAliasType("Value", Union[str, int, bool]) + + +class FilterClauseTypedDict(TypedDict): + property: str + operator: FilterOperator + value: ValueTypedDict + + +class FilterClause(BaseModel): + property: str + + operator: FilterOperator + + value: Value diff --git a/src/polar_sdk/models/filterconjunction.py b/src/polar_sdk/models/filterconjunction.py new file mode 100644 index 00000000..00a6ce9d --- /dev/null +++ b/src/polar_sdk/models/filterconjunction.py @@ -0,0 +1,9 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class FilterConjunction(str, Enum): + AND = "and" + OR = "or" diff --git a/src/polar_sdk/models/filteroperator.py b/src/polar_sdk/models/filteroperator.py new file mode 100644 index 00000000..0dc66a74 --- /dev/null +++ b/src/polar_sdk/models/filteroperator.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class FilterOperator(str, Enum): + EQ = "eq" + NE = "ne" + GT = "gt" + GTE = "gte" + LT = "lt" + LTE = "lte" + LIKE = "like" + NOT_LIKE = "not_like" diff --git a/src/polar_sdk/models/listresource_event_.py b/src/polar_sdk/models/listresource_event_.py new file mode 100644 index 00000000..144eebcd --- /dev/null +++ b/src/polar_sdk/models/listresource_event_.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .event import Event, EventTypedDict +from .pagination import Pagination, PaginationTypedDict +from polar_sdk.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListResourceEventTypedDict(TypedDict): + items: List[EventTypedDict] + pagination: PaginationTypedDict + + +class ListResourceEvent(BaseModel): + items: List[Event] + + pagination: Pagination diff --git a/src/polar_sdk/models/listresource_meter_.py b/src/polar_sdk/models/listresource_meter_.py new file mode 100644 index 00000000..bd932aef --- /dev/null +++ b/src/polar_sdk/models/listresource_meter_.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .meter import Meter, MeterTypedDict +from .pagination import Pagination, PaginationTypedDict +from polar_sdk.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListResourceMeterTypedDict(TypedDict): + items: List[MeterTypedDict] + pagination: PaginationTypedDict + + +class ListResourceMeter(BaseModel): + items: List[Meter] + + pagination: Pagination diff --git a/src/polar_sdk/models/meter.py b/src/polar_sdk/models/meter.py new file mode 100644 index 00000000..d1086f55 --- /dev/null +++ b/src/polar_sdk/models/meter.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .countaggregation import CountAggregation, CountAggregationTypedDict +from .filter_ import Filter, FilterTypedDict +from .propertyaggregation import PropertyAggregation, PropertyAggregationTypedDict +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, UNSET_SENTINEL +from polar_sdk.utils import get_discriminator +import pydantic +from pydantic import Discriminator, Tag, model_serializer +from typing import Dict, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +MeterMetadataTypedDict = TypeAliasType("MeterMetadataTypedDict", Union[str, int, bool]) + + +MeterMetadata = TypeAliasType("MeterMetadata", Union[str, int, bool]) + + +MeterAggregationTypedDict = TypeAliasType( + "MeterAggregationTypedDict", + Union[CountAggregationTypedDict, PropertyAggregationTypedDict], +) +r"""The aggregation to apply on the filtered events to calculate the meter.""" + + +MeterAggregation = Annotated[ + Union[ + Annotated[PropertyAggregation, Tag("avg")], + Annotated[CountAggregation, Tag("count")], + Annotated[PropertyAggregation, Tag("max")], + Annotated[PropertyAggregation, Tag("min")], + Annotated[PropertyAggregation, Tag("sum")], + ], + Discriminator(lambda m: get_discriminator(m, "func", "func")), +] +r"""The aggregation to apply on the filtered events to calculate the meter.""" + + +class MeterTypedDict(TypedDict): + metadata: Dict[str, MeterMetadataTypedDict] + created_at: datetime + r"""Creation timestamp of the object.""" + modified_at: Nullable[datetime] + r"""Last modification timestamp of the object.""" + id: str + r"""The ID of the object.""" + name: str + r"""The name of the meter. Will be shown on customer's invoices and usage.""" + filter_: FilterTypedDict + aggregation: MeterAggregationTypedDict + r"""The aggregation to apply on the filtered events to calculate the meter.""" + organization_id: str + r"""The ID of the organization owning the meter.""" + + +class Meter(BaseModel): + metadata: Dict[str, MeterMetadata] + + created_at: datetime + r"""Creation timestamp of the object.""" + + modified_at: Nullable[datetime] + r"""Last modification timestamp of the object.""" + + id: str + r"""The ID of the object.""" + + name: str + r"""The name of the meter. Will be shown on customer's invoices and usage.""" + + filter_: Annotated[Filter, pydantic.Field(alias="filter")] + + aggregation: MeterAggregation + r"""The aggregation to apply on the filtered events to calculate the meter.""" + + organization_id: str + r"""The ID of the organization owning the meter.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["modified_at"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/metercreate.py b/src/polar_sdk/models/metercreate.py new file mode 100644 index 00000000..9449dafa --- /dev/null +++ b/src/polar_sdk/models/metercreate.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .countaggregation import CountAggregation, CountAggregationTypedDict +from .filter_ import Filter, FilterTypedDict +from .propertyaggregation import PropertyAggregation, PropertyAggregationTypedDict +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import get_discriminator +import pydantic +from pydantic import Discriminator, Tag, model_serializer +from typing import Dict, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +MeterCreateMetadataTypedDict = TypeAliasType( + "MeterCreateMetadataTypedDict", Union[str, int, bool] +) + + +MeterCreateMetadata = TypeAliasType("MeterCreateMetadata", Union[str, int, bool]) + + +MeterCreateAggregationTypedDict = TypeAliasType( + "MeterCreateAggregationTypedDict", + Union[CountAggregationTypedDict, PropertyAggregationTypedDict], +) +r"""The aggregation to apply on the filtered events to calculate the meter.""" + + +MeterCreateAggregation = Annotated[ + Union[ + Annotated[PropertyAggregation, Tag("avg")], + Annotated[CountAggregation, Tag("count")], + Annotated[PropertyAggregation, Tag("max")], + Annotated[PropertyAggregation, Tag("min")], + Annotated[PropertyAggregation, Tag("sum")], + ], + Discriminator(lambda m: get_discriminator(m, "func", "func")), +] +r"""The aggregation to apply on the filtered events to calculate the meter.""" + + +class MeterCreateTypedDict(TypedDict): + name: str + r"""The name of the meter. Will be shown on customer's invoices and usage.""" + filter_: FilterTypedDict + aggregation: MeterCreateAggregationTypedDict + r"""The aggregation to apply on the filtered events to calculate the meter.""" + metadata: NotRequired[Dict[str, MeterCreateMetadataTypedDict]] + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A boolean + + You can store up to **50 key-value pairs**. + """ + organization_id: NotRequired[Nullable[str]] + r"""The ID of the organization owning the meter. **Required unless you use an organization token.**""" + + +class MeterCreate(BaseModel): + name: str + r"""The name of the meter. Will be shown on customer's invoices and usage.""" + + filter_: Annotated[Filter, pydantic.Field(alias="filter")] + + aggregation: MeterCreateAggregation + r"""The aggregation to apply on the filtered events to calculate the meter.""" + + metadata: Optional[Dict[str, MeterCreateMetadata]] = None + r"""Key-value object allowing you to store additional information. + + The key must be a string with a maximum length of **40 characters**. + The value must be either: + + * A string with a maximum length of **500 characters** + * An integer + * A boolean + + You can store up to **50 key-value pairs**. + """ + + organization_id: OptionalNullable[str] = UNSET + r"""The ID of the organization owning the meter. **Required unless you use an organization token.**""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["metadata", "organization_id"] + nullable_fields = ["organization_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/meterquantities.py b/src/polar_sdk/models/meterquantities.py new file mode 100644 index 00000000..c420b062 --- /dev/null +++ b/src/polar_sdk/models/meterquantities.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .meterquantity import MeterQuantity, MeterQuantityTypedDict +from polar_sdk.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class MeterQuantitiesTypedDict(TypedDict): + quantities: List[MeterQuantityTypedDict] + + +class MeterQuantities(BaseModel): + quantities: List[MeterQuantity] diff --git a/src/polar_sdk/models/meterquantity.py b/src/polar_sdk/models/meterquantity.py new file mode 100644 index 00000000..7ecccb0b --- /dev/null +++ b/src/polar_sdk/models/meterquantity.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from polar_sdk.types import BaseModel +from typing_extensions import TypedDict + + +class MeterQuantityTypedDict(TypedDict): + timestamp: datetime + r"""The timestamp for the current period.""" + quantity: float + r"""The quantity for the current period.""" + + +class MeterQuantity(BaseModel): + timestamp: datetime + r"""The timestamp for the current period.""" + + quantity: float + r"""The quantity for the current period.""" diff --git a/src/polar_sdk/models/meters_eventsop.py b/src/polar_sdk/models/meters_eventsop.py new file mode 100644 index 00000000..051f44cd --- /dev/null +++ b/src/polar_sdk/models/meters_eventsop.py @@ -0,0 +1,46 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .listresource_event_ import ListResourceEvent, ListResourceEventTypedDict +from polar_sdk.types import BaseModel +from polar_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from typing import Callable, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MetersEventsRequestTypedDict(TypedDict): + id: str + r"""The meter ID.""" + page: NotRequired[int] + r"""Page number, defaults to 1.""" + limit: NotRequired[int] + r"""Size of a page, defaults to 10. Maximum is 100.""" + + +class MetersEventsRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The meter ID.""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number, defaults to 1.""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 10 + r"""Size of a page, defaults to 10. Maximum is 100.""" + + +class MetersEventsResponseTypedDict(TypedDict): + result: ListResourceEventTypedDict + + +class MetersEventsResponse(BaseModel): + next: Callable[[], Optional[MetersEventsResponse]] + + result: ListResourceEvent diff --git a/src/polar_sdk/models/meters_getop.py b/src/polar_sdk/models/meters_getop.py new file mode 100644 index 00000000..21c5c9eb --- /dev/null +++ b/src/polar_sdk/models/meters_getop.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from polar_sdk.types import BaseModel +from polar_sdk.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class MetersGetRequestTypedDict(TypedDict): + id: str + r"""The meter ID.""" + + +class MetersGetRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The meter ID.""" diff --git a/src/polar_sdk/models/meters_quantitiesop.py b/src/polar_sdk/models/meters_quantitiesop.py new file mode 100644 index 00000000..4571da05 --- /dev/null +++ b/src/polar_sdk/models/meters_quantitiesop.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .timeinterval import TimeInterval +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +MetersQuantitiesQueryParamCustomerIDFilterTypedDict = TypeAliasType( + "MetersQuantitiesQueryParamCustomerIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + +MetersQuantitiesQueryParamCustomerIDFilter = TypeAliasType( + "MetersQuantitiesQueryParamCustomerIDFilter", Union[str, List[str]] +) +r"""Filter by customer ID.""" + + +QueryParamExternalCustomerIDFilterTypedDict = TypeAliasType( + "QueryParamExternalCustomerIDFilterTypedDict", Union[str, List[str]] +) +r"""Filter by external customer ID.""" + + +QueryParamExternalCustomerIDFilter = TypeAliasType( + "QueryParamExternalCustomerIDFilter", Union[str, List[str]] +) +r"""Filter by external customer ID.""" + + +class MetersQuantitiesRequestTypedDict(TypedDict): + id: str + r"""The meter ID.""" + start_timestamp: datetime + r"""Start timestamp.""" + end_timestamp: datetime + r"""End timestamp.""" + interval: TimeInterval + r"""Interval between two timestamps.""" + customer_id: NotRequired[ + Nullable[MetersQuantitiesQueryParamCustomerIDFilterTypedDict] + ] + r"""Filter by customer ID.""" + exernal_customer_id: NotRequired[ + Nullable[QueryParamExternalCustomerIDFilterTypedDict] + ] + r"""Filter by external customer ID.""" + + +class MetersQuantitiesRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The meter ID.""" + + start_timestamp: Annotated[ + datetime, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) + ] + r"""Start timestamp.""" + + end_timestamp: Annotated[ + datetime, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) + ] + r"""End timestamp.""" + + interval: Annotated[ + TimeInterval, + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] + r"""Interval between two timestamps.""" + + customer_id: Annotated[ + OptionalNullable[MetersQuantitiesQueryParamCustomerIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by customer ID.""" + + exernal_customer_id: Annotated[ + OptionalNullable[QueryParamExternalCustomerIDFilter], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by external customer ID.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["customer_id", "exernal_customer_id"] + nullable_fields = ["customer_id", "exernal_customer_id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/meters_updateop.py b/src/polar_sdk/models/meters_updateop.py new file mode 100644 index 00000000..e7803d04 --- /dev/null +++ b/src/polar_sdk/models/meters_updateop.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .meterupdate import MeterUpdate, MeterUpdateTypedDict +from polar_sdk.types import BaseModel +from polar_sdk.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class MetersUpdateRequestTypedDict(TypedDict): + id: str + r"""The meter ID.""" + meter_update: MeterUpdateTypedDict + + +class MetersUpdateRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The meter ID.""" + + meter_update: Annotated[ + MeterUpdate, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/polar_sdk/models/metersortproperty.py b/src/polar_sdk/models/metersortproperty.py new file mode 100644 index 00000000..e037d6c4 --- /dev/null +++ b/src/polar_sdk/models/metersortproperty.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class MeterSortProperty(str, Enum): + CREATED_AT = "created_at" + MINUS_CREATED_AT = "-created_at" + NAME = "name" + MINUS_NAME = "-name" diff --git a/src/polar_sdk/models/meterupdate.py b/src/polar_sdk/models/meterupdate.py new file mode 100644 index 00000000..b2a51ec3 --- /dev/null +++ b/src/polar_sdk/models/meterupdate.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .countaggregation import CountAggregation, CountAggregationTypedDict +from .filter_ import Filter, FilterTypedDict +from .propertyaggregation import PropertyAggregation, PropertyAggregationTypedDict +from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL +from polar_sdk.utils import get_discriminator +import pydantic +from pydantic import Discriminator, Tag, model_serializer +from typing import Dict, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +MeterUpdateMetadataTypedDict = TypeAliasType( + "MeterUpdateMetadataTypedDict", Union[str, int, bool] +) + + +MeterUpdateMetadata = TypeAliasType("MeterUpdateMetadata", Union[str, int, bool]) + + +AggregationTypedDict = TypeAliasType( + "AggregationTypedDict", + Union[CountAggregationTypedDict, PropertyAggregationTypedDict], +) + + +Aggregation = Annotated[ + Union[ + Annotated[PropertyAggregation, Tag("avg")], + Annotated[CountAggregation, Tag("count")], + Annotated[PropertyAggregation, Tag("max")], + Annotated[PropertyAggregation, Tag("min")], + Annotated[PropertyAggregation, Tag("sum")], + ], + Discriminator(lambda m: get_discriminator(m, "func", "func")), +] + + +class MeterUpdateTypedDict(TypedDict): + metadata: NotRequired[Nullable[Dict[str, MeterUpdateMetadataTypedDict]]] + name: NotRequired[Nullable[str]] + r"""The name of the meter. Will be shown on customer's invoices and usage.""" + filter_: NotRequired[Nullable[FilterTypedDict]] + r"""The filter to apply on events that'll be used to calculate the meter.""" + aggregation: NotRequired[Nullable[AggregationTypedDict]] + r"""The aggregation to apply on the filtered events to calculate the meter.""" + + +class MeterUpdate(BaseModel): + metadata: OptionalNullable[Dict[str, MeterUpdateMetadata]] = UNSET + + name: OptionalNullable[str] = UNSET + r"""The name of the meter. Will be shown on customer's invoices and usage.""" + + filter_: Annotated[OptionalNullable[Filter], pydantic.Field(alias="filter")] = UNSET + r"""The filter to apply on events that'll be used to calculate the meter.""" + + aggregation: OptionalNullable[Aggregation] = UNSET + r"""The aggregation to apply on the filtered events to calculate the meter.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["metadata", "name", "filter", "aggregation"] + nullable_fields = ["metadata", "name", "filter", "aggregation"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/polar_sdk/models/metrics_getop.py b/src/polar_sdk/models/metrics_getop.py index 152c8bb6..85a55cda 100644 --- a/src/polar_sdk/models/metrics_getop.py +++ b/src/polar_sdk/models/metrics_getop.py @@ -1,8 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .interval import Interval from .productpricetype import ProductPriceType +from .timeinterval import TimeInterval from datetime import date from polar_sdk.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from polar_sdk.utils import FieldMetadata, QueryParamMetadata @@ -65,7 +65,7 @@ class MetricsGetRequestTypedDict(TypedDict): r"""Start date.""" end_date: date r"""End date.""" - interval: Interval + interval: TimeInterval r"""Interval between two timestamps.""" organization_id: NotRequired[ Nullable[MetricsGetQueryParamOrganizationIDFilterTypedDict] @@ -91,7 +91,8 @@ class MetricsGetRequest(BaseModel): r"""End date.""" interval: Annotated[ - Interval, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) + TimeInterval, + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] r"""Interval between two timestamps.""" diff --git a/src/polar_sdk/models/oauth2client.py b/src/polar_sdk/models/oauth2client.py index ae4a32e9..c48b09d3 100644 --- a/src/polar_sdk/models/oauth2client.py +++ b/src/polar_sdk/models/oauth2client.py @@ -69,7 +69,7 @@ class OAuth2Client(BaseModel): response_types: Optional[List[str]] = None scope: Optional[str] = ( - "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 products:read products:write benefits:read benefits:write events:read events:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write 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" + "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 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_sessions:write orders:read refunds:read refunds:write 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" ) client_uri: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/oauth2clientconfiguration.py b/src/polar_sdk/models/oauth2clientconfiguration.py index 9423b2cd..af3be8d9 100644 --- a/src/polar_sdk/models/oauth2clientconfiguration.py +++ b/src/polar_sdk/models/oauth2clientconfiguration.py @@ -48,7 +48,7 @@ class OAuth2ClientConfiguration(BaseModel): response_types: Optional[List[str]] = None scope: Optional[str] = ( - "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 products:read products:write benefits:read benefits:write events:read events:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write 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" + "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 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_sessions:write orders:read refunds:read refunds:write 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" ) client_uri: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/oauth2clientconfigurationupdate.py b/src/polar_sdk/models/oauth2clientconfigurationupdate.py index 8b7b96e6..a4502ceb 100644 --- a/src/polar_sdk/models/oauth2clientconfigurationupdate.py +++ b/src/polar_sdk/models/oauth2clientconfigurationupdate.py @@ -51,7 +51,7 @@ class OAuth2ClientConfigurationUpdate(BaseModel): response_types: Optional[List[str]] = None scope: Optional[str] = ( - "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 products:read products:write benefits:read benefits:write events:read events:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write 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" + "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 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_sessions:write orders:read refunds:read refunds:write 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" ) client_uri: OptionalNullable[str] = UNSET diff --git a/src/polar_sdk/models/propertyaggregation.py b/src/polar_sdk/models/propertyaggregation.py new file mode 100644 index 00000000..f66f5935 --- /dev/null +++ b/src/polar_sdk/models/propertyaggregation.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from polar_sdk.types import BaseModel +from typing_extensions import TypedDict + + +class Func(str, Enum): + SUM = "sum" + MAX = "max" + MIN = "min" + AVG = "avg" + + +class PropertyAggregationTypedDict(TypedDict): + func: Func + property: str + + +class PropertyAggregation(BaseModel): + func: Func + + property: str diff --git a/src/polar_sdk/models/scope.py b/src/polar_sdk/models/scope.py index f83a8018..389acdbc 100644 --- a/src/polar_sdk/models/scope.py +++ b/src/polar_sdk/models/scope.py @@ -27,6 +27,8 @@ class Scope(str, Enum): BENEFITS_WRITE = "benefits:write" EVENTS_READ = "events:read" EVENTS_WRITE = "events:write" + METERS_READ = "meters:read" + METERS_WRITE = "meters:write" FILES_READ = "files:read" FILES_WRITE = "files:write" SUBSCRIPTIONS_READ = "subscriptions:read" diff --git a/src/polar_sdk/models/interval.py b/src/polar_sdk/models/timeinterval.py similarity index 87% rename from src/polar_sdk/models/interval.py rename to src/polar_sdk/models/timeinterval.py index d06c739f..fdd28a63 100644 --- a/src/polar_sdk/models/interval.py +++ b/src/polar_sdk/models/timeinterval.py @@ -4,7 +4,7 @@ from enum import Enum -class Interval(str, Enum): +class TimeInterval(str, Enum): YEAR = "year" MONTH = "month" WEEK = "week" diff --git a/src/polar_sdk/orders.py b/src/polar_sdk/orders.py index 1d3498f5..d9389a5f 100644 --- a/src/polar_sdk/orders.py +++ b/src/polar_sdk/orders.py @@ -148,15 +148,17 @@ def next_func() -> Optional[models.OrdersListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.OrdersListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceOrder), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -316,15 +318,17 @@ def next_func() -> Optional[models.OrdersListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.OrdersListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceOrder), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -411,15 +415,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Order) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -506,15 +514,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Order) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -601,15 +613,19 @@ def invoice( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.OrderInvoice) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -696,15 +712,19 @@ async def invoice_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.OrderInvoice) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/organizations.py b/src/polar_sdk/organizations.py index cf7a240e..d4b8dc4d 100644 --- a/src/polar_sdk/organizations.py +++ b/src/polar_sdk/organizations.py @@ -110,7 +110,7 @@ def next_func() -> Optional[models.OrganizationsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.OrganizationsListResponse( result=utils.unmarshal_json( @@ -119,8 +119,10 @@ def next_func() -> Optional[models.OrganizationsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -242,7 +244,7 @@ def next_func() -> Optional[models.OrganizationsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.OrganizationsListResponse( result=utils.unmarshal_json( @@ -251,8 +253,10 @@ def next_func() -> Optional[models.OrganizationsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -342,12 +346,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -437,12 +443,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -529,15 +537,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -624,15 +636,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -733,18 +749,22 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -845,18 +865,22 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/polar_customers.py b/src/polar_sdk/polar_customers.py index 661f27f8..2a1174fa 100644 --- a/src/polar_sdk/polar_customers.py +++ b/src/polar_sdk/polar_customers.py @@ -74,15 +74,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerPortalCustomer) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -169,15 +173,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerPortalCustomer) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/polar_license_keys.py b/src/polar_sdk/polar_license_keys.py index 7613aaf0..45bc308b 100644 --- a/src/polar_sdk/polar_license_keys.py +++ b/src/polar_sdk/polar_license_keys.py @@ -113,7 +113,7 @@ def next_func() -> Optional[models.CustomerPortalLicenseKeysListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalLicenseKeysListResponse( result=utils.unmarshal_json( @@ -122,14 +122,18 @@ def next_func() -> Optional[models.CustomerPortalLicenseKeysListResponse]: next=next_func, ) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -254,7 +258,7 @@ def next_func() -> Optional[models.CustomerPortalLicenseKeysListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalLicenseKeysListResponse( result=utils.unmarshal_json( @@ -263,14 +267,18 @@ def next_func() -> Optional[models.CustomerPortalLicenseKeysListResponse]: next=next_func, ) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) - raise models.Unauthorized(data=data) + response_data = utils.unmarshal_json(http_res.text, models.UnauthorizedData) + raise models.Unauthorized(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -357,15 +365,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyWithActivations) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -452,15 +464,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyWithActivations) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -550,15 +566,19 @@ def validate( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.ValidatedLicenseKey) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -648,15 +668,19 @@ async def validate_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.ValidatedLicenseKey) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -746,18 +770,22 @@ def activate( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyActivationRead) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -847,18 +875,22 @@ async def activate_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.LicenseKeyActivationRead) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -950,15 +982,19 @@ def deactivate( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1050,15 +1086,19 @@ async def deactivate_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "204", "*"): return if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/polar_orders.py b/src/polar_sdk/polar_orders.py index 75d7bbd3..4c9dcba1 100644 --- a/src/polar_sdk/polar_orders.py +++ b/src/polar_sdk/polar_orders.py @@ -146,7 +146,7 @@ def next_func() -> Optional[models.CustomerPortalOrdersListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalOrdersListResponse( result=utils.unmarshal_json( @@ -155,8 +155,10 @@ def next_func() -> Optional[models.CustomerPortalOrdersListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -314,7 +316,7 @@ def next_func() -> Optional[models.CustomerPortalOrdersListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalOrdersListResponse( result=utils.unmarshal_json( @@ -323,8 +325,10 @@ def next_func() -> Optional[models.CustomerPortalOrdersListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -411,15 +415,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerOrder) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -506,15 +514,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerOrder) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -601,15 +613,19 @@ def invoice( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerOrderInvoice) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -696,15 +712,19 @@ async def invoice_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerOrderInvoice) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/polar_organizations.py b/src/polar_sdk/polar_organizations.py index 639d64f2..f0bd4fef 100644 --- a/src/polar_sdk/polar_organizations.py +++ b/src/polar_sdk/polar_organizations.py @@ -74,15 +74,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -169,15 +173,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Organization) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/polar_subscriptions.py b/src/polar_sdk/polar_subscriptions.py index a8cbcc3e..f0ec69b0 100644 --- a/src/polar_sdk/polar_subscriptions.py +++ b/src/polar_sdk/polar_subscriptions.py @@ -134,7 +134,7 @@ def next_func() -> Optional[models.CustomerPortalSubscriptionsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalSubscriptionsListResponse( result=utils.unmarshal_json( @@ -143,8 +143,10 @@ def next_func() -> Optional[models.CustomerPortalSubscriptionsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -290,7 +292,7 @@ def next_func() -> Optional[models.CustomerPortalSubscriptionsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CustomerPortalSubscriptionsListResponse( result=utils.unmarshal_json( @@ -299,8 +301,10 @@ def next_func() -> Optional[models.CustomerPortalSubscriptionsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -387,15 +391,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSubscription) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -482,15 +490,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSubscription) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -592,20 +604,24 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSubscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -707,20 +723,24 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSubscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -807,20 +827,24 @@ def cancel( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSubscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -907,20 +931,24 @@ async def cancel_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.CustomerSubscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/products.py b/src/polar_sdk/products.py index 37d8f74c..c4365459 100644 --- a/src/polar_sdk/products.py +++ b/src/polar_sdk/products.py @@ -142,15 +142,17 @@ def next_func() -> Optional[models.ProductsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ProductsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceProduct), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -304,15 +306,17 @@ def next_func() -> Optional[models.ProductsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ProductsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceProduct), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -402,12 +406,14 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -497,12 +503,14 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -589,15 +597,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -684,15 +696,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -787,18 +803,22 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -893,18 +913,22 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -1005,18 +1029,22 @@ def update_benefits( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1117,18 +1145,22 @@ async def update_benefits_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Product) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/refunds.py b/src/polar_sdk/refunds.py index c06c6feb..db2ebb59 100644 --- a/src/polar_sdk/refunds.py +++ b/src/polar_sdk/refunds.py @@ -146,15 +146,17 @@ def next_func() -> Optional[models.RefundsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.RefundsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceRefund), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -312,15 +314,17 @@ def next_func() -> Optional[models.RefundsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.RefundsListResponse( result=utils.unmarshal_json(http_res.text, models.ListResourceRefund), next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -410,20 +414,26 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Refund) if utils.match_response(http_res, "201", "*"): return None if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, models.RefundAmountTooHighData) - raise models.RefundAmountTooHigh(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.RefundAmountTooHighData + ) + raise models.RefundAmountTooHigh(data=response_data) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.RefundedAlreadyData) - raise models.RefundedAlready(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.RefundedAlreadyData + ) + raise models.RefundedAlready(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -513,20 +523,26 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Refund) if utils.match_response(http_res, "201", "*"): return None if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json(http_res.text, models.RefundAmountTooHighData) - raise models.RefundAmountTooHigh(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.RefundAmountTooHighData + ) + raise models.RefundAmountTooHigh(data=response_data) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.RefundedAlreadyData) - raise models.RefundedAlready(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.RefundedAlreadyData + ) + raise models.RefundedAlready(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/repositories.py b/src/polar_sdk/repositories.py index 0a108779..c834fd9b 100644 --- a/src/polar_sdk/repositories.py +++ b/src/polar_sdk/repositories.py @@ -146,7 +146,7 @@ def next_func() -> Optional[models.RepositoriesListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.RepositoriesListResponse( result=utils.unmarshal_json( @@ -155,8 +155,10 @@ def next_func() -> Optional[models.RepositoriesListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -314,7 +316,7 @@ def next_func() -> Optional[models.RepositoriesListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.RepositoriesListResponse( result=utils.unmarshal_json( @@ -323,8 +325,10 @@ def next_func() -> Optional[models.RepositoriesListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -411,15 +415,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Repository) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -506,15 +514,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Repository) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -611,18 +623,22 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Repository) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -719,18 +735,22 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Repository) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json(http_res.text, models.NotPermittedData) - raise models.NotPermitted(data=data) + response_data = utils.unmarshal_json(http_res.text, models.NotPermittedData) + raise models.NotPermitted(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( diff --git a/src/polar_sdk/sdk.py b/src/polar_sdk/sdk.py index bfdecec0..1e7f93a8 100644 --- a/src/polar_sdk/sdk.py +++ b/src/polar_sdk/sdk.py @@ -17,9 +17,11 @@ from polar_sdk.customer_sessions import CustomerSessions from polar_sdk.customers import Customers from polar_sdk.discounts import Discounts +from polar_sdk.events import Events from polar_sdk.external_organizations import ExternalOrganizations from polar_sdk.files import Files from polar_sdk.license_keys import LicenseKeys +from polar_sdk.meters import Meters from polar_sdk.metrics_sdk import MetricsSDK from polar_sdk.oauth2 import Oauth2 from polar_sdk.orders import Orders @@ -59,6 +61,8 @@ class Polar(BaseSDK): customers: Customers customer_portal: CustomerPortal customer_sessions: CustomerSessions + events: Events + meters: Meters def __init__( self, @@ -168,6 +172,8 @@ def _init_sdks(self): self.customers = Customers(self.sdk_configuration) self.customer_portal = CustomerPortal(self.sdk_configuration) self.customer_sessions = CustomerSessions(self.sdk_configuration) + self.events = Events(self.sdk_configuration) + self.meters = Meters(self.sdk_configuration) def __enter__(self): return self diff --git a/src/polar_sdk/subscriptions.py b/src/polar_sdk/subscriptions.py index c4d051bd..48556f44 100644 --- a/src/polar_sdk/subscriptions.py +++ b/src/polar_sdk/subscriptions.py @@ -137,7 +137,7 @@ def next_func() -> Optional[models.SubscriptionsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscriptionsListResponse( result=utils.unmarshal_json( @@ -146,8 +146,10 @@ def next_func() -> Optional[models.SubscriptionsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -296,7 +298,7 @@ def next_func() -> Optional[models.SubscriptionsListResponse]: retries=retries, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SubscriptionsListResponse( result=utils.unmarshal_json( @@ -305,8 +307,10 @@ def next_func() -> Optional[models.SubscriptionsListResponse]: next=next_func, ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -395,12 +399,14 @@ def export( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -489,12 +495,14 @@ async def export_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, Any) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -581,15 +589,19 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Subscription) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -676,15 +688,19 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Subscription) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -785,20 +801,24 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Subscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -899,20 +919,24 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Subscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError( @@ -999,20 +1023,24 @@ def revoke( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Subscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) raise models.SDKError( @@ -1099,20 +1127,24 @@ async def revoke_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Subscription) if utils.match_response(http_res, "403", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, models.AlreadyCanceledSubscriptionData ) - raise models.AlreadyCanceledSubscription(data=data) + raise models.AlreadyCanceledSubscription(data=response_data) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, models.ResourceNotFoundData) - raise models.ResourceNotFound(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.ResourceNotFoundData + ) + raise models.ResourceNotFound(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData) - raise models.HTTPValidationError(data=data) + response_data = utils.unmarshal_json( + http_res.text, models.HTTPValidationErrorData + ) + raise models.HTTPValidationError(data=response_data) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.SDKError(