From 602ac1f5ffe9799890e5c9d909c6ba200c68d983 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 20 Dec 2024 00:13:46 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.456.1 --- .speakeasy/gen.lock | 29 ++- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 14 +- README.md | 4 + RELEASES.md | 12 +- codeSamples.yaml | 6 + docs/models/customersession.md | 16 ++ docs/models/customersessioncreate.md | 10 + docs/models/scope.md | 1 + docs/sdks/customersessions/README.md | 48 +++++ pyproject.toml | 2 +- src/polar_sdk/_version.py | 2 +- src/polar_sdk/customer_sessions.py | 193 ++++++++++++++++++ src/polar_sdk/models/__init__.py | 6 + src/polar_sdk/models/customersession.py | 76 +++++++ src/polar_sdk/models/customersessioncreate.py | 19 ++ src/polar_sdk/models/oauth2client.py | 2 +- .../models/oauth2clientconfiguration.py | 2 +- .../models/oauth2clientconfigurationupdate.py | 2 +- src/polar_sdk/models/scope.py | 1 + src/polar_sdk/sdk.py | 3 + src/polar_sdk/sdkconfiguration.py | 4 +- 22 files changed, 431 insertions(+), 23 deletions(-) create mode 100644 docs/models/customersession.md create mode 100644 docs/models/customersessioncreate.md create mode 100644 docs/sdks/customersessions/README.md create mode 100644 src/polar_sdk/customer_sessions.py create mode 100644 src/polar_sdk/models/customersession.py create mode 100644 src/polar_sdk/models/customersessioncreate.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ff81294..2cae5a0 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: 62e6096c95dd267726f5489a38313f3f + docChecksum: 509f7f04da4bb45734ebdd8250c8c50d docVersion: 0.1.0 - speakeasyVersion: 1.456.0 + speakeasyVersion: 1.456.1 generationVersion: 2.481.0 - releaseVersion: 0.11.0 - configChecksum: e5de9f0e36b363df172792cf779d9f78 + releaseVersion: 0.11.1 + configChecksum: 04241663b7633c95f84d095f1dd0c083 repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git published: true @@ -299,6 +299,8 @@ generatedFiles: - docs/models/customerportalsubscriptionslistresponse.md - docs/models/customerportalsubscriptionsupdaterequest.md - docs/models/customersdeleterequest.md + - docs/models/customersession.md + - docs/models/customersessioncreate.md - docs/models/customersgetrequest.md - docs/models/customerslistqueryparamorganizationidfilter.md - docs/models/customerslistrequest.md @@ -752,6 +754,7 @@ generatedFiles: - docs/sdks/custom/README.md - docs/sdks/customerportal/README.md - docs/sdks/customers/README.md + - docs/sdks/customersessions/README.md - docs/sdks/customfields/README.md - docs/sdks/discounts/README.md - docs/sdks/downloadables/README.md @@ -792,6 +795,7 @@ generatedFiles: - src/polar_sdk/custom.py - src/polar_sdk/custom_fields.py - src/polar_sdk/customer_portal.py + - src/polar_sdk/customer_sessions.py - src/polar_sdk/customers.py - src/polar_sdk/discounts.py - src/polar_sdk/downloadables.py @@ -962,6 +966,8 @@ generatedFiles: - src/polar_sdk/models/customers_getop.py - src/polar_sdk/models/customers_listop.py - src/polar_sdk/models/customers_updateop.py + - src/polar_sdk/models/customersession.py + - src/polar_sdk/models/customersessioncreate.py - src/polar_sdk/models/customersortproperty.py - src/polar_sdk/models/customersubscription.py - src/polar_sdk/models/customersubscriptionproduct.py @@ -2080,7 +2086,7 @@ examples: speakeasy-default-checkouts:custom:list: responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "status": "open", "client_secret": "", "url": "https://average-fedora.org/", "expires_at": "2022-09-09T18:28:08.953Z", "success_url": "https://primary-paintwork.com/", "embed_origin": "", "amount": 718303, "tax_amount": 86140, "currency": "Convertible Marks", "subtotal_amount": 768578, "total_amount": 687960, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": true, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Adam7@yahoo.com", "customer_ip_address": "", "customer_billing_address": {"country": "Mauritius"}, "customer_tax_id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "product": {"created_at": "2024-04-22T08:39:55.981Z", "modified_at": "2023-08-23T19:26:20.850Z", "id": "", "name": "", "description": "mmm avalanche jungle unto meanwhile beside tromp worth", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "type": "downloadables", "description": "bob inwardly beautifully comparison", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-02-10T20:11:51.410Z", "modified_at": "2023-05-17T08:33:13.471Z", "id": "", "type": "github_repository", "description": "commonly softly boo massive sorrowful aw strict behind along energetic", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-04-12T03:59:08.538Z", "modified_at": "2023-04-20T11:47:41.889Z", "id": "", "type": "discord", "description": "cleverly blossom defiantly", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 704478, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-05-27T06:03:00.110Z", "version": "", "is_uploaded": false, "created_at": "2024-01-10T05:13:52.456Z", "size_readable": "", "public_url": "https://jam-packed-median.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/var/yp", "mime_type": "", "size": 186930, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-03-11T17:32:08.709Z", "version": "", "is_uploaded": false, "created_at": "2022-12-07T09:46:44.632Z", "size_readable": "", "public_url": "https://hateful-linseed.info"}, {"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 694688, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-08-19T17:38:55.606Z", "version": "", "is_uploaded": false, "created_at": "2024-10-13T14:46:57.561Z", "size_readable": "", "public_url": "https://left-exterior.biz/"}]}, "product_price": {"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, "discount": {"duration": "repeating", "type": "fixed", "amount": 5229, "currency": "Syrian Pound", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-02-27T06:14:46.641Z", "modified_at": "2022-04-05T09:49:38.010Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 33597, "required": false}], "customer_metadata": {"key": 633911, "key1": ""}}, {"created_at": "2022-01-21T00:48:05.986Z", "modified_at": "2024-09-10T07:49:25.657Z", "id": "", "status": "confirmed", "client_secret": "", "url": "https://practical-trick.org/", "expires_at": "2024-09-28T03:47:03.515Z", "success_url": "https://blue-technologist.com/", "embed_origin": "", "amount": 460276, "tax_amount": 425334, "currency": "Kenyan Shilling", "subtotal_amount": 406555, "total_amount": 480616, "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": "Roman.Stracke39@yahoo.com", "customer_ip_address": "", "customer_billing_address": {"country": "China"}, "customer_tax_id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "product": {"created_at": "2023-12-15T18:53:29.970Z", "modified_at": "2023-10-06T17:09:46.559Z", "id": "", "name": "", "description": "soap cheerfully distinction range", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-06-17T08:36:51.636Z", "modified_at": "2022-03-22T06:10:55.267Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 567445, "maximum_amount": 876407, "preset_amount": 490078, "recurring_interval": "month"}, {"created_at": "2022-01-21T00:48:05.986Z", "modified_at": "2024-09-10T07:49:25.657Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, {"created_at": "2024-09-10T04:30:13.188Z", "modified_at": "2022-05-29T14:05:29.727Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 425334, "recurring_interval": "month"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/src", "mime_type": "", "size": 88338, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-07T09:30:51.196Z", "version": "", "is_uploaded": false, "created_at": "2024-10-06T07:08:41.329Z", "size_readable": "", "public_url": "https://damaged-tapioca.com"}, {"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 387926, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-05T10:11:23.447Z", "version": "", "is_uploaded": true, "created_at": "2024-05-23T21:54:30.697Z", "size_readable": "", "public_url": "https://favorite-digit.biz"}]}, "product_price": {"created_at": "2023-07-29T04:00:22.486Z", "modified_at": "2024-07-10T18:28:07.954Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 863466, "recurring_interval": "month"}, "discount": {"duration": "forever", "type": "percentage", "amount": 751563, "currency": "Fiji Dollar", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-05-05T09:08:16.530Z", "modified_at": "2022-07-18T12:08:53.113Z", "id": "", "metadata": {"key": "", "key1": 934960, "key2": true}, "slug": "", "name": "", "organization_id": ""}, "order": 810770, "required": false}], "customer_metadata": {"key": 838930, "key1": false}}, {"created_at": "2022-04-03T06:30:19.876Z", "modified_at": "2024-01-30T10:30:11.361Z", "id": "", "status": "confirmed", "client_secret": "", "url": "https://bustling-plastic.info/", "expires_at": "2024-07-08T11:13:00.198Z", "success_url": "https://yummy-birdcage.com", "embed_origin": "", "amount": 73973, "tax_amount": 836788, "currency": "Leone", "subtotal_amount": 385327, "total_amount": 141764, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Oswald29@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Saint Helena"}, "customer_tax_id": "", "metadata": {"key": ""}, "product": {"created_at": "2022-04-29T02:27:27.855Z", "modified_at": "2024-09-02T23:08:00.186Z", "id": "", "name": "", "description": "frenetically from yuck failing consign tedious scar failing unknown in", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2022-03-23T01:47:30.770Z", "modified_at": "2024-07-06T02:51:23.749Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 141764, "recurring_interval": "year"}], "benefits": [{"created_at": "2022-07-20T03:42:25.608Z", "modified_at": "2022-08-23T12:47:09.406Z", "id": "", "type": "ads", "description": "toothpick silently aftermath never tooth swelter fund provided although dreary", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 679829, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-04-24T19:54:59.989Z", "version": "", "is_uploaded": false, "created_at": "2023-08-01T10:27:50.144Z", "size_readable": "", "public_url": "https://plump-markup.net"}]}, "product_price": {"created_at": "2023-08-20T22:29:27.736Z", "modified_at": "2022-03-15T10:11:56.132Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "forever", "duration_in_months": 973913, "type": "fixed", "basis_points": 18518, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-03-30T07:52:25.805Z", "modified_at": "2022-10-11T19:17:33.283Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 282091, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-05-04T10:59:46.313Z", "modified_at": "2022-01-06T17:33:20.863Z", "id": "", "metadata": {"key": false, "key1": 948614, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}]}}, "order": 634941, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-03-07T11:07:08.720Z", "modified_at": "2024-04-21T16:08:32.154Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 520064, "required": false}], "customer_metadata": {"key": false, "key1": 41398}}], "pagination": {"total_count": 5229, "max_page": 810770}} + application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "status": "open", "client_secret": "", "url": "https://average-fedora.org/", "expires_at": "2022-09-09T18:28:08.953Z", "success_url": "https://primary-paintwork.com/", "embed_origin": "", "amount": 718303, "tax_amount": 86140, "currency": "Convertible Marks", "subtotal_amount": 768578, "total_amount": 687960, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": true, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Adam7@yahoo.com", "customer_ip_address": "", "customer_billing_address": {"country": "Mauritius"}, "customer_tax_id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "product": {"created_at": "2024-04-22T08:39:55.981Z", "modified_at": "2023-08-23T19:26:20.850Z", "id": "", "name": "", "description": "mmm avalanche jungle unto meanwhile beside tromp worth", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "type": "downloadables", "description": "bob inwardly beautifully comparison", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-02-10T20:11:51.410Z", "modified_at": "2023-05-17T08:33:13.471Z", "id": "", "type": "github_repository", "description": "commonly softly boo massive sorrowful aw strict behind along energetic", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-04-12T03:59:08.538Z", "modified_at": "2023-04-20T11:47:41.889Z", "id": "", "type": "discord", "description": "cleverly blossom defiantly", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 704478, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-05-27T06:03:00.110Z", "version": "", "is_uploaded": false, "created_at": "2024-01-10T05:13:52.456Z", "size_readable": "", "public_url": "https://jam-packed-median.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/var/yp", "mime_type": "", "size": 186930, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-03-11T17:32:08.709Z", "version": "", "is_uploaded": false, "created_at": "2022-12-07T09:46:44.632Z", "size_readable": "", "public_url": "https://hateful-linseed.info"}, {"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 694688, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-08-19T17:38:55.606Z", "version": "", "is_uploaded": false, "created_at": "2024-10-13T14:46:57.561Z", "size_readable": "", "public_url": "https://left-exterior.biz/"}]}, "product_price": {"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, "discount": {"duration": "repeating", "type": "fixed", "amount": 5229, "currency": "Syrian Pound", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-02-27T06:14:46.641Z", "modified_at": "2022-04-05T09:49:38.010Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 33597, "required": false}], "customer_metadata": {"key": 633911, "key1": ""}}, {"created_at": "2022-01-21T00:48:05.986Z", "modified_at": "2024-09-10T07:49:25.657Z", "id": "", "status": "confirmed", "client_secret": "", "url": "https://practical-trick.org/", "expires_at": "2024-09-28T03:47:03.515Z", "success_url": "https://blue-technologist.com/", "embed_origin": "", "amount": 460276, "tax_amount": 425334, "currency": "Kenyan Shilling", "subtotal_amount": 406555, "total_amount": 480616, "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": "Roman.Stracke39@yahoo.com", "customer_ip_address": "", "customer_billing_address": {"country": "China"}, "customer_tax_id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "product": {"created_at": "2023-12-15T18:53:29.970Z", "modified_at": "2023-10-06T17:09:46.559Z", "id": "", "name": "", "description": "soap cheerfully distinction range", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-11-26T18:23:24.264Z", "modified_at": "2022-01-09T04:26:27.312Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 367745, "maximum_amount": 485729, "preset_amount": 73227}, {"created_at": "2024-08-18T13:00:42.665Z", "modified_at": "2023-06-22T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}, {"created_at": "2024-09-28T03:47:03.515Z", "modified_at": "2022-07-09T16:58:41.012Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 897069, "maximum_amount": 135572, "preset_amount": 460276}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/src", "mime_type": "", "size": 88338, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-07T09:30:51.196Z", "version": "", "is_uploaded": false, "created_at": "2024-10-06T07:08:41.329Z", "size_readable": "", "public_url": "https://damaged-tapioca.com"}, {"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 387926, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-05T10:11:23.447Z", "version": "", "is_uploaded": true, "created_at": "2024-05-23T21:54:30.697Z", "size_readable": "", "public_url": "https://favorite-digit.biz"}]}, "product_price": {"created_at": "2023-06-11T18:07:18.321Z", "modified_at": "2022-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"}, "discount": {"duration": "forever", "type": "percentage", "amount": 751563, "currency": "Fiji Dollar", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-05-05T09:08:16.530Z", "modified_at": "2022-07-18T12:08:53.113Z", "id": "", "metadata": {"key": "", "key1": 934960, "key2": true}, "slug": "", "name": "", "organization_id": ""}, "order": 810770, "required": false}], "customer_metadata": {"key": 838930, "key1": false}}, {"created_at": "2022-04-03T06:30:19.876Z", "modified_at": "2024-01-30T10:30:11.361Z", "id": "", "status": "confirmed", "client_secret": "", "url": "https://bustling-plastic.info/", "expires_at": "2024-07-08T11:13:00.198Z", "success_url": "https://yummy-birdcage.com", "embed_origin": "", "amount": 73973, "tax_amount": 836788, "currency": "Leone", "subtotal_amount": 385327, "total_amount": 141764, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Oswald29@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Saint Helena"}, "customer_tax_id": "", "metadata": {"key": ""}, "product": {"created_at": "2022-04-29T02:27:27.855Z", "modified_at": "2024-09-02T23:08:00.186Z", "id": "", "name": "", "description": "frenetically from yuck failing consign tedious scar failing unknown in", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-12-27T15:09:02.427Z", "modified_at": "2022-03-31T02:45:39.610Z", "id": "", "is_archived": true, "product_id": ""}], "benefits": [{"created_at": "2022-07-20T03:42:25.608Z", "modified_at": "2022-08-23T12:47:09.406Z", "id": "", "type": "ads", "description": "toothpick silently aftermath never tooth swelter fund provided although dreary", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 679829, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-04-24T19:54:59.989Z", "version": "", "is_uploaded": false, "created_at": "2023-08-01T10:27:50.144Z", "size_readable": "", "public_url": "https://plump-markup.net"}]}, "product_price": {"created_at": "2024-05-01T20:38:29.097Z", "modified_at": "2022-06-05T08:58:03.644Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "forever", "duration_in_months": 973913, "type": "fixed", "basis_points": 18518, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-08-20T22:29:27.736Z", "modified_at": "2022-03-15T10:11:56.132Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}]}}, "order": 282091, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-03-30T07:52:25.805Z", "modified_at": "2022-10-11T19:17:33.283Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 634941, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-05-04T10:59:46.313Z", "modified_at": "2022-01-06T17:33:20.863Z", "id": "", "metadata": {"key": false, "key1": 948614, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}]}}, "order": 520064, "required": false}], "customer_metadata": {"key": false, "key1": 41398}}], "pagination": {"total_count": 5229, "max_page": 810770}} "422": application/json: {} checkouts:custom:create: @@ -2355,7 +2361,7 @@ examples: _endpointsubscription_updated_post: speakeasy-default-endpointsubscription-updated-post: requestBody: - application/json: {"data": {"created_at": "2022-08-16T06:35:49.390Z", "modified_at": "2024-11-13T10:48:05.575Z", "id": "", "amount": 299644, "currency": "Baht", "recurring_interval": "year", "status": "trialing", "current_period_start": "2024-10-06T07:01:55.000Z", "current_period_end": "2024-01-21T06:59:31.349Z", "cancel_at_period_end": false, "started_at": "2022-10-04T04:56:04.382Z", "ended_at": "2022-01-22T12:57:07.430Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": "", "key1": 442859, "key2": 394013}, "customer": {"created_at": "2022-08-16T06:35:49.390Z", "modified_at": "2024-11-13T10:48:05.575Z", "id": "", "metadata": {"key": ""}, "email": "Thea1@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Nepal"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://unruly-release.org/"}, "user_id": "", "user": {"id": "", "email": "Napoleon_Crist@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-09-03T02:13:58.900Z", "modified_at": "2022-01-06T20:49:48.804Z", "id": "", "name": "", "description": "tall sans now duh mysteriously", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 128620, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-03T11:59:38.300Z", "version": "", "is_uploaded": true, "created_at": "2024-02-16T13:33:22.624Z", "size_readable": "", "public_url": "https://cute-schedule.com"}], "attached_custom_fields": []}, "price": {"created_at": "2022-11-25T09:50:52.301Z", "modified_at": "2024-06-16T22:58:18.488Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "repeating", "duration_in_months": 917422, "type": "fixed", "basis_points": 19653, "created_at": "2024-08-08T17:53:12.513Z", "modified_at": "2022-10-08T02:40:52.099Z", "id": "", "metadata": {"key": 435982, "key1": 900724}, "name": "", "code": "", "starts_at": "2024-03-24T00:03:13.207Z", "ends_at": "2024-08-03T15:54:12.951Z", "max_redemptions": 155569, "redemptions_count": 853807, "organization_id": ""}}} + application/json: {"data": {"created_at": "2022-08-16T06:35:49.390Z", "modified_at": "2024-11-13T10:48:05.575Z", "id": "", "amount": 299644, "currency": "Baht", "recurring_interval": "year", "status": "trialing", "current_period_start": "2024-10-06T07:01:55.000Z", "current_period_end": "2024-01-21T06:59:31.349Z", "cancel_at_period_end": false, "started_at": "2022-10-04T04:56:04.382Z", "ended_at": "2022-01-22T12:57:07.430Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": "", "key1": 442859, "key2": 394013}, "customer": {"created_at": "2022-08-16T06:35:49.390Z", "modified_at": "2024-11-13T10:48:05.575Z", "id": "", "metadata": {"key": ""}, "email": "Thea1@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Nepal"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://unruly-release.org/"}, "user_id": "", "user": {"id": "", "email": "Napoleon_Crist@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-09-03T02:13:58.900Z", "modified_at": "2022-01-06T20:49:48.804Z", "id": "", "name": "", "description": "tall sans now duh mysteriously", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 128620, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-03T11:59:38.300Z", "version": "", "is_uploaded": true, "created_at": "2024-02-16T13:33:22.624Z", "size_readable": "", "public_url": "https://cute-schedule.com"}], "attached_custom_fields": []}, "price": {"created_at": "2024-11-13T10:48:05.575Z", "modified_at": "2022-11-25T09:50:52.301Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 830034, "recurring_interval": "month"}, "discount": {"duration": "repeating", "duration_in_months": 917422, "type": "fixed", "basis_points": 19653, "created_at": "2024-08-08T17:53:12.513Z", "modified_at": "2022-10-08T02:40:52.099Z", "id": "", "metadata": {"key": 435982, "key1": 900724}, "name": "", "code": "", "starts_at": "2024-03-24T00:03:13.207Z", "ends_at": "2024-08-03T15:54:12.951Z", "max_redemptions": 155569, "redemptions_count": 853807, "organization_id": ""}}} responses: "200": application/json: "" @@ -2382,7 +2388,7 @@ examples: _endpointsubscription_revoked_post: speakeasy-default-endpointsubscription-revoked-post: requestBody: - application/json: {"data": {"created_at": "2024-11-29T12:00:55.925Z", "modified_at": "2022-03-13T04:36:55.320Z", "id": "", "amount": 780683, "currency": "CFP Franc", "recurring_interval": "year", "status": "trialing", "current_period_start": "2022-06-20T05:55:42.170Z", "current_period_end": "2023-05-17T17:55:53.899Z", "cancel_at_period_end": true, "started_at": "2024-10-25T10:04:20.460Z", "ended_at": "2023-09-30T18:36:35.285Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": 721489}, "customer": {"created_at": "2024-11-29T12:00:55.925Z", "modified_at": "2022-03-13T04:36:55.320Z", "id": "", "metadata": {"key": true, "key1": "", "key2": ""}, "email": "Jeremie35@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Timor-Leste"}, "tax_id": ["br_cnpj", "ca_pst_mb", "bh_vat"], "organization_id": "", "avatar_url": "https://valuable-rim.name"}, "user_id": "", "user": {"id": "", "email": "Sierra.Moore60@gmail.com", "public_name": ""}, "product": {"created_at": "2024-04-13T14:40:28.840Z", "modified_at": "2023-11-21T04:26:42.625Z", "id": "", "name": "", "description": "and blindly off except once", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": 892144, "key1": ""}, "prices": [], "benefits": [{"created_at": "2024-11-17T16:25:39.728Z", "modified_at": "2023-08-17T13:41:14.572Z", "id": "", "description": "forgery supposing ostrich tousle evenly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {"key": false, "key1": true, "key2": true}, "files": [""]}}, {"created_at": "2022-04-29T03:02:51.228Z", "modified_at": "2022-05-13T00:57:09.668Z", "id": "", "description": "second management whose underachieve weakly yippee yesterday seldom inasmuch", "selectable": true, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "admin"}}, {"created_at": "2023-12-15T07:14:12.681Z", "modified_at": "2022-07-18T22:29:18.081Z", "id": "", "description": "spew smoggy thoroughly silently but unbearably sans amidst accelerator broadly", "selectable": false, "deletable": false, "organization_id": "", "properties": {"archived": {"key": false, "key1": false, "key2": false}, "files": ["", ""]}}], "medias": [], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-02-21T12:52:20.879Z", "modified_at": "2023-06-05T23:29:37.118Z", "id": "", "metadata": {"key": false, "key1": 357231}, "slug": "", "name": "", "organization_id": ""}, "order": 679852, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-05-16T07:34:44.765Z", "modified_at": "2022-07-10T13:02:53.009Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 63475, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2022-05-19T15:16:20.086Z", "modified_at": "2023-08-05T01:33:08.166Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 436843, "required": true}]}, "price": {"created_at": "2024-01-30T23:50:59.422Z", "modified_at": "2024-02-17T23:24:58.135Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "repeating", "duration_in_months": 77485, "type": "fixed", "amount": 580218, "currency": "Aruban Guilder", "created_at": "2023-06-04T08:19:48.070Z", "modified_at": "2022-09-25T21:18:32.510Z", "id": "", "metadata": {"key": 357142, "key1": "", "key2": true}, "name": "", "code": "", "starts_at": "2024-04-06T00:05:35.224Z", "ends_at": "2024-05-04T02:15:43.487Z", "max_redemptions": 679852, "redemptions_count": 34814, "organization_id": ""}}} + application/json: {"data": {"created_at": "2024-11-29T12:00:55.925Z", "modified_at": "2022-03-13T04:36:55.320Z", "id": "", "amount": 780683, "currency": "CFP Franc", "recurring_interval": "year", "status": "trialing", "current_period_start": "2022-06-20T05:55:42.170Z", "current_period_end": "2023-05-17T17:55:53.899Z", "cancel_at_period_end": true, "started_at": "2024-10-25T10:04:20.460Z", "ended_at": "2023-09-30T18:36:35.285Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": 721489}, "customer": {"created_at": "2024-11-29T12:00:55.925Z", "modified_at": "2022-03-13T04:36:55.320Z", "id": "", "metadata": {"key": true, "key1": "", "key2": ""}, "email": "Jeremie35@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Timor-Leste"}, "tax_id": ["br_cnpj", "ca_pst_mb", "bh_vat"], "organization_id": "", "avatar_url": "https://valuable-rim.name"}, "user_id": "", "user": {"id": "", "email": "Sierra.Moore60@gmail.com", "public_name": ""}, "product": {"created_at": "2024-04-13T14:40:28.840Z", "modified_at": "2023-11-21T04:26:42.625Z", "id": "", "name": "", "description": "and blindly off except once", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": 892144, "key1": ""}, "prices": [], "benefits": [{"created_at": "2022-03-13T04:36:55.320Z", "modified_at": "2024-05-05T15:05:02.863Z", "id": "", "description": "mom nun up bar slime ghost in unfortunate nucleotidase yahoo", "selectable": false, "deletable": true, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 409053, "timeframe": "month"}, "activations": {"limit": 85523, "enable_customer_admin": false}, "limit_usage": 528613}}, {"created_at": "2023-07-27T22:37:48.771Z", "modified_at": "2022-07-08T15:43:38.078Z", "id": "", "description": "comestible save spark accentuate", "selectable": false, "deletable": true, "organization_id": "", "properties": {"archived": {}, "files": [""]}}, {"created_at": "2024-06-06T16:36:59.904Z", "modified_at": "2023-12-15T07:14:12.681Z", "id": "", "description": "when submissive desk how", "selectable": false, "deletable": false, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 620052, "timeframe": "month"}, "activations": {"limit": 77915, "enable_customer_admin": true}, "limit_usage": 893478}}], "medias": [], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-03-24T11:18:28.141Z", "modified_at": "2023-06-03T22:09:28.859Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 679852, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-08-02T21:30:57.659Z", "modified_at": "2022-10-18T08:45:20.322Z", "id": "", "metadata": {"key": 273261, "key1": 500371, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 63475, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-04-07T09:34:20.163Z", "modified_at": "2023-04-24T06:28:00.706Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 436843, "required": true}]}, "price": {"created_at": "2022-04-15T20:44:08.164Z", "modified_at": "2022-05-20T15:08:40.297Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 206819, "maximum_amount": 54522, "preset_amount": 337977, "recurring_interval": "month"}, "discount": {"duration": "once", "duration_in_months": 602455, "type": "fixed", "basis_points": 157916, "created_at": "2024-12-02T06:57:31.584Z", "modified_at": "2024-04-06T17:31:04.776Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2022-04-03T10:04:32.370Z", "ends_at": "2024-08-11T06:28:29.006Z", "max_redemptions": 721627, "redemptions_count": 941681, "organization_id": ""}}} responses: "200": application/json: "" @@ -2736,4 +2742,13 @@ examples: application/json: {"detail": ""} "422": application/json: {} + customer-sessions:create: + speakeasy-default-customer-sessions:create: + requestBody: + application/json: {"customer_id": ""} + responses: + "201": + application/json: {"created_at": "2023-06-18T07:14:55.338Z", "modified_at": "2023-12-01T17:06:07.804Z", "id": "", "token": "", "expires_at": "2023-04-03T12:48:32.253Z", "customer_id": "", "customer": {"created_at": "2022-05-28T06:20:22.766Z", "modified_at": "2022-03-17T15:39:20.911Z", "id": "", "metadata": {"key": true, "key1": "", "key2": ""}, "email": "Raymundo_Rolfson35@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Cyprus"}, "tax_id": [], "organization_id": "", "avatar_url": "https://glorious-convection.com/"}} + "422": + application/json: {} generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 5c0fc06..8d398ae 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,7 +16,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false python: - version: 0.11.0 + version: 0.11.1 additionalDependencies: dev: pytest: ^8.3.3 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4f44c84..9e27f65 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.456.0 +speakeasyVersion: 1.456.1 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:bf5ff5b95a411e176747cc3d436aa5e5587c97a32cf7d19697fad3bbf66de6a2 - sourceBlobDigest: sha256:937f1e89736ba0d1ed3c2affd965fdb1e7213012c7b7f15b20541a9e9f829620 + sourceRevisionDigest: sha256:6c834590418d648bd10d0825628fe11bda41e355840bcb83319e3435ca322d5b + sourceBlobDigest: sha256:2fcb4a497110dfacf53652f840b4586fd532f15ddfa11dc8329db9987c54371a tags: - latest - - speakeasy-sdk-regen-1734426902 + - speakeasy-sdk-regen-1734653531 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:bf5ff5b95a411e176747cc3d436aa5e5587c97a32cf7d19697fad3bbf66de6a2 - sourceBlobDigest: sha256:937f1e89736ba0d1ed3c2affd965fdb1e7213012c7b7f15b20541a9e9f829620 + sourceRevisionDigest: sha256:6c834590418d648bd10d0825628fe11bda41e355840bcb83319e3435ca322d5b + sourceBlobDigest: sha256:2fcb4a497110dfacf53652f840b4586fd532f15ddfa11dc8329db9987c54371a codeSamplesNamespace: polar-oas-code-samples - codeSamplesRevisionDigest: sha256:6d72157e60f4b6c750710d45f83796e1d03eec680f8aa712d0e076c995a8280c + codeSamplesRevisionDigest: sha256:8343363a8e0f25db3b3bdbcc73302d71c8c9b25ad9f0905047f680d6398fa774 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 8fb089f..b594e26 100644 --- a/README.md +++ b/README.md @@ -575,6 +575,10 @@ def webhook(): * [update](docs/sdks/polarsubscriptions/README.md#update) - Update Subscription * [cancel](docs/sdks/polarsubscriptions/README.md#cancel) - Cancel Subscription +### [customer_sessions](docs/sdks/customersessions/README.md) + +* [create](docs/sdks/customersessions/README.md#create) - Create Customer Session + ### [customers](docs/sdks/customers/README.md) * [list](docs/sdks/customers/README.md#list) - List Customers diff --git a/RELEASES.md b/RELEASES.md index 85f839d..49e3fd4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -393,4 +393,14 @@ Based on: ### Generated - [python v0.11.0] . ### Releases -- [PyPI v0.11.0] https://pypi.org/project/polar-sdk/0.11.0 - . \ No newline at end of file +- [PyPI v0.11.0] https://pypi.org/project/polar-sdk/0.11.0 - . + +## 2024-12-20 00:12:07 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.456.1 (2.481.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.1] . +### Releases +- [PyPI v0.11.1] https://pypi.org/project/polar-sdk/0.11.1 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 1768dd1..9e3b746 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -267,6 +267,12 @@ actions: - "lang": "python" "label": "update" "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_portal.subscriptions.update(id=\"\", customer_subscription_update={\n \"product_price_id\": \"\",\n })\n\n # Handle response\n print(res)" + - target: $["paths"]["/v1/customer-sessions/"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "create" + "source": "from polar_sdk import Polar\n\nwith Polar(\n access_token=\"\",\n) as polar:\n\n res = polar.customer_sessions.create(request={\n \"customer_id\": \"\",\n })\n\n # Handle response\n print(res)" - target: $["paths"]["/v1/customers/"]["get"] update: "x-codeSamples": diff --git a/docs/models/customersession.md b/docs/models/customersession.md new file mode 100644 index 0000000..2295d79 --- /dev/null +++ b/docs/models/customersession.md @@ -0,0 +1,16 @@ +# CustomerSession + +A customer session that can be used to authenticate as a customer. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `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. | +| `token` | *str* | :heavy_check_mark: | N/A | +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `customer_id` | *str* | :heavy_check_mark: | N/A | +| `customer` | [models.Customer](../models/customer.md) | :heavy_check_mark: | A customer in an organization. | \ No newline at end of file diff --git a/docs/models/customersessioncreate.md b/docs/models/customersessioncreate.md new file mode 100644 index 0000000..0eefe7a --- /dev/null +++ b/docs/models/customersessioncreate.md @@ -0,0 +1,10 @@ +# CustomerSessionCreate + +Schema for creating a customer session. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `customer_id` | *str* | :heavy_check_mark: | ID of the customer to create a session for. | \ No newline at end of file diff --git a/docs/models/scope.md b/docs/models/scope.md index f3e0314..cf3758c 100644 --- a/docs/models/scope.md +++ b/docs/models/scope.md @@ -31,6 +31,7 @@ | `SUBSCRIPTIONS_WRITE` | subscriptions:write | | `CUSTOMERS_READ` | customers:read | | `CUSTOMERS_WRITE` | customers:write | +| `CUSTOMER_SESSIONS_WRITE` | customer_sessions:write | | `ORDERS_READ` | orders:read | | `METRICS_READ` | metrics:read | | `WEBHOOKS_READ` | webhooks:read | diff --git a/docs/sdks/customersessions/README.md b/docs/sdks/customersessions/README.md new file mode 100644 index 0000000..4b82945 --- /dev/null +++ b/docs/sdks/customersessions/README.md @@ -0,0 +1,48 @@ +# CustomerSessions +(*customer_sessions*) + +## Overview + +### Available Operations + +* [create](#create) - Create Customer Session + +## create + +Create a customer session. + +### Example Usage + +```python +from polar_sdk import Polar + +with Polar( + access_token="", +) as polar: + + res = polar.customer_sessions.create(request={ + "customer_id": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `request` | [models.CustomerSessionCreate](../../models/customersessioncreate.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.CustomerSession](../../models/customersession.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/pyproject.toml b/pyproject.toml index ffdc53b..f46ee6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polar-sdk" -version = "0.11.0" +version = "0.11.1" description = "Polar SDK for Python" authors = ["Polar",] readme = "README-PYPI.md" diff --git a/src/polar_sdk/_version.py b/src/polar_sdk/_version.py index ac2ddda..391bdd5 100644 --- a/src/polar_sdk/_version.py +++ b/src/polar_sdk/_version.py @@ -3,7 +3,7 @@ import importlib.metadata __title__: str = "polar-sdk" -__version__: str = "0.11.0" +__version__: str = "0.11.1" try: if __package__ is not None: diff --git a/src/polar_sdk/customer_sessions.py b/src/polar_sdk/customer_sessions.py new file mode 100644 index 0000000..4c0ca2f --- /dev/null +++ b/src/polar_sdk/customer_sessions.py @@ -0,0 +1,193 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from polar_sdk import models, utils +from polar_sdk._hooks import HookContext +from polar_sdk.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Mapping, Optional, Union, cast + + +class CustomerSessions(BaseSDK): + def create( + self, + *, + request: Union[ + models.CustomerSessionCreate, models.CustomerSessionCreateTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerSession: + r"""Create Customer Session + + Create a customer session. + + :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.CustomerSessionCreate) + request = cast(models.CustomerSessionCreate, request) + + req = self.build_request( + method="POST", + path="/v1/customer-sessions/", + 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.CustomerSessionCreate + ), + 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="customer-sessions:create", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + 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) + if utils.match_response(http_res, ["4XX", "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.CustomerSessionCreate, models.CustomerSessionCreateTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CustomerSession: + r"""Create Customer Session + + Create a customer session. + + :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.CustomerSessionCreate) + request = cast(models.CustomerSessionCreate, request) + + req = self.build_request_async( + method="POST", + path="/v1/customer-sessions/", + 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.CustomerSessionCreate + ), + 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="customer-sessions:create", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + 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) + if utils.match_response(http_res, ["4XX", "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/models/__init__.py b/src/polar_sdk/models/__init__.py index 45d963d..cf3d425 100644 --- a/src/polar_sdk/models/__init__.py +++ b/src/polar_sdk/models/__init__.py @@ -710,6 +710,8 @@ CustomersListResponseTypedDict, ) from .customers_updateop import CustomersUpdateRequest, CustomersUpdateRequestTypedDict +from .customersession import CustomerSession, CustomerSessionTypedDict +from .customersessioncreate import CustomerSessionCreate, CustomerSessionCreateTypedDict from .customersortproperty import CustomerSortProperty from .customersubscription import CustomerSubscription, CustomerSubscriptionTypedDict from .customersubscriptionproduct import ( @@ -2222,6 +2224,10 @@ "CustomerPortalSubscriptionsListResponseTypedDict", "CustomerPortalSubscriptionsUpdateRequest", "CustomerPortalSubscriptionsUpdateRequestTypedDict", + "CustomerSession", + "CustomerSessionCreate", + "CustomerSessionCreateTypedDict", + "CustomerSessionTypedDict", "CustomerSortProperty", "CustomerSubscription", "CustomerSubscriptionProduct", diff --git a/src/polar_sdk/models/customersession.py b/src/polar_sdk/models/customersession.py new file mode 100644 index 0000000..71d0f9f --- /dev/null +++ b/src/polar_sdk/models/customersession.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .customer import Customer, CustomerTypedDict +from datetime import datetime +from polar_sdk.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class CustomerSessionTypedDict(TypedDict): + r"""A customer session that can be used to authenticate as a customer.""" + + 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.""" + token: str + expires_at: datetime + customer_id: str + customer: CustomerTypedDict + r"""A customer in an organization.""" + + +class CustomerSession(BaseModel): + r"""A customer session that can be used to authenticate as a customer.""" + + 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.""" + + token: str + + expires_at: datetime + + customer_id: str + + customer: Customer + r"""A customer in an organization.""" + + @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/customersessioncreate.py b/src/polar_sdk/models/customersessioncreate.py new file mode 100644 index 0000000..c2283b0 --- /dev/null +++ b/src/polar_sdk/models/customersessioncreate.py @@ -0,0 +1,19 @@ +"""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 CustomerSessionCreateTypedDict(TypedDict): + r"""Schema for creating a customer session.""" + + customer_id: str + r"""ID of the customer to create a session for.""" + + +class CustomerSessionCreate(BaseModel): + r"""Schema for creating a customer session.""" + + customer_id: str + r"""ID of the customer to create a session for.""" diff --git a/src/polar_sdk/models/oauth2client.py b/src/polar_sdk/models/oauth2client.py index f680b80..50f4a39 100644 --- a/src/polar_sdk/models/oauth2client.py +++ b/src/polar_sdk/models/oauth2client.py @@ -73,7 +73,7 @@ class OAuth2Client(BaseModel): response_types: Optional[List[ResponseTypes]] = 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 files:read files:write subscriptions:read subscriptions:write customers:read customers:write orders:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write" + "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 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 e594ff0..657fb7e 100644 --- a/src/polar_sdk/models/oauth2clientconfiguration.py +++ b/src/polar_sdk/models/oauth2clientconfiguration.py @@ -52,7 +52,7 @@ class OAuth2ClientConfiguration(BaseModel): response_types: Optional[List[OAuth2ClientConfigurationResponseTypes]] = 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 files:read files:write subscriptions:read subscriptions:write customers:read customers:write orders:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write" + "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 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 0ef2b6a..0fae1c2 100644 --- a/src/polar_sdk/models/oauth2clientconfigurationupdate.py +++ b/src/polar_sdk/models/oauth2clientconfigurationupdate.py @@ -55,7 +55,7 @@ class OAuth2ClientConfigurationUpdate(BaseModel): response_types: Optional[List[OAuth2ClientConfigurationUpdateResponseTypes]] = 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 files:read files:write subscriptions:read subscriptions:write customers:read customers:write orders:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write" + "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 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/scope.py b/src/polar_sdk/models/scope.py index d55dac0..fcf76e3 100644 --- a/src/polar_sdk/models/scope.py +++ b/src/polar_sdk/models/scope.py @@ -31,6 +31,7 @@ class Scope(str, Enum): SUBSCRIPTIONS_WRITE = "subscriptions:write" CUSTOMERS_READ = "customers:read" CUSTOMERS_WRITE = "customers:write" + CUSTOMER_SESSIONS_WRITE = "customer_sessions:write" ORDERS_READ = "orders:read" METRICS_READ = "metrics:read" WEBHOOKS_READ = "webhooks:read" diff --git a/src/polar_sdk/sdk.py b/src/polar_sdk/sdk.py index 8df49c9..ba28849 100644 --- a/src/polar_sdk/sdk.py +++ b/src/polar_sdk/sdk.py @@ -14,6 +14,7 @@ from polar_sdk.checkouts import Checkouts from polar_sdk.custom_fields import CustomFields from polar_sdk.customer_portal import CustomerPortal +from polar_sdk.customer_sessions import CustomerSessions from polar_sdk.customers import Customers from polar_sdk.discounts import Discounts from polar_sdk.external_organizations import ExternalOrganizations @@ -54,6 +55,7 @@ class Polar(BaseSDK): discounts: Discounts customers: Customers customer_portal: CustomerPortal + customer_sessions: CustomerSessions def __init__( self, @@ -152,6 +154,7 @@ def _init_sdks(self): self.discounts = Discounts(self.sdk_configuration) self.customers = Customers(self.sdk_configuration) self.customer_portal = CustomerPortal(self.sdk_configuration) + self.customer_sessions = CustomerSessions(self.sdk_configuration) def __enter__(self): return self diff --git a/src/polar_sdk/sdkconfiguration.py b/src/polar_sdk/sdkconfiguration.py index 1ef6846..5476e24 100644 --- a/src/polar_sdk/sdkconfiguration.py +++ b/src/polar_sdk/sdkconfiguration.py @@ -31,9 +31,9 @@ class SDKConfiguration: server: Optional[str] = "" language: str = "python" openapi_doc_version: str = "0.1.0" - sdk_version: str = "0.11.0" + sdk_version: str = "0.11.1" gen_version: str = "2.481.0" - user_agent: str = "speakeasy-sdk/python 0.11.0 2.481.0 0.1.0 polar-sdk" + user_agent: str = "speakeasy-sdk/python 0.11.1 2.481.0 0.1.0 polar-sdk" retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None