From d82b3705c4d1c1449ef4e89b7db1508d082ded7e Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 29 Aug 2024 16:21:37 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.382.0 --- .speakeasy/gen.lock | 4 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 11 +- RELEASES.md | 10 +- codeSamples.yaml | 798 +++++++++++++++++----------------- pyproject.toml | 2 +- src/polar/sdkconfiguration.py | 4 +- 7 files changed, 420 insertions(+), 411 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ca0556f..b5d6f4e 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -5,8 +5,8 @@ management: docVersion: 0.1.0 speakeasyVersion: 1.382.0 generationVersion: 2.404.11 - releaseVersion: 0.1.2 - configChecksum: 3e5e0cf61b4419d9e2b7d7f284cf6341 + releaseVersion: 0.1.3 + configChecksum: 9202319aefbe5f66e57c1b09e9bac14e repoURL: https://github.com/polarsource/polar-python.git installationURL: https://github.com/polarsource/polar-python.git features: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 81d585d..fa2c3ed 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -15,7 +15,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true python: - version: 0.1.2 + version: 0.1.3 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index cc860da..3649528 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,17 +2,18 @@ speakeasyVersion: 1.382.0 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:1e2849f7a74db51b770b51c1566f3a3075ebba3501d38f14756df5e146eea5b2 - sourceBlobDigest: sha256:2e445b28e1c8f9fe80a9f4cfd04b44748fc6daa3cc521d13d73ea571bec616f2 + sourceRevisionDigest: sha256:19ff53595232890cef232fc6931e820feeea0e0c71f084811d2ab3d2d50363fe + sourceBlobDigest: sha256:3303542239bcd6692ae1b85934483e76917bf962b7ffdddbe792c78718887a36 tags: - latest + - main targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:1e2849f7a74db51b770b51c1566f3a3075ebba3501d38f14756df5e146eea5b2 - sourceBlobDigest: sha256:2e445b28e1c8f9fe80a9f4cfd04b44748fc6daa3cc521d13d73ea571bec616f2 - outLocation: /Users/fvoron/Development/polar-python + sourceRevisionDigest: sha256:19ff53595232890cef232fc6931e820feeea0e0c71f084811d2ab3d2d50363fe + sourceBlobDigest: sha256:3303542239bcd6692ae1b85934483e76917bf962b7ffdddbe792c78718887a36 + outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index 47e5587..c88fbf1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -14,4 +14,12 @@ Based on: - OpenAPI Doc - Speakeasy CLI 1.382.0 (2.404.11) https://github.com/speakeasy-api/speakeasy ### Generated -- [python v0.0.2] . \ No newline at end of file +- [python v0.0.2] . + +## 2024-08-29 16:20:27 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.382.0 (2.404.11) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.1.3] . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 11737e1..8aabae7 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,11 +3,11 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: - - target: $["paths"]["/v1/users/subscriptions/"]["get"] + - target: $["paths"]["/v1/benefits/{id}"]["patch"] update: x-codeSamples: - lang: python - label: list + label: update source: |- from polar import Polar @@ -16,20 +16,16 @@ actions: ) - res = s.users.subscriptions.list() + res = s.benefits.update(id="", request_body={}) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/orders/"]["get"] + # handle response + pass + - target: $["paths"]["/v1/products/{id}"]["patch"] update: x-codeSamples: - lang: python - label: list + label: update source: |- from polar import Polar @@ -38,16 +34,12 @@ actions: ) - res = s.orders.list() + res = s.products.update(id="", product_update={}) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/organizations/"]["get"] + # handle response + pass + - target: $["paths"]["/v1/users/advertisements/"]["get"] update: x-codeSamples: - lang: python @@ -60,7 +52,7 @@ actions: ) - res = s.organizations.list() + res = s.users.advertisements.list() if res is not None: while True: @@ -69,11 +61,11 @@ actions: res = res.Next() if res is None: break - - target: $["paths"]["/v1/organizations/{id}"]["get"] + - target: $["paths"]["/v1/users/downloadables/"]["get"] update: x-codeSamples: - lang: python - label: get + label: list source: |- from polar import Polar @@ -82,12 +74,16 @@ actions: ) - res = s.organizations.retrieve(id="") + res = s.users.downloadables.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/files/"]["post"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/organizations/"]["post"] update: x-codeSamples: - lang: python @@ -100,29 +96,19 @@ actions: ) - res = s.files.create(request={ + res = s.organizations.create(request={ "name": "", - "mime_type": "", - "size": 489382, - "upload": { - "parts": [ - { - "number": 638424, - "chunk_start": 859213, - "chunk_end": 417458, - }, - ], - }, + "slug": "", }) if res is not None: # handle response pass - - target: $["paths"]["/v1/users/benefits/{id}"]["get"] + - target: $["paths"]["/v1/products/"]["get"] update: x-codeSamples: - lang: python - label: get + label: list source: |- from polar import Polar @@ -131,17 +117,22 @@ actions: ) - res = s.users.benefits.retrieve(id="") + res = s.products.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/users/advertisements/{id}"]["get"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/products/"]["post"] update: x-codeSamples: - lang: python - label: get + label: create source: |- + import polar from polar import Polar s = Polar( @@ -149,16 +140,24 @@ actions: ) - res = s.users.advertisements.retrieve(id="") + res = s.products.create(request={ + "name": "", + "prices": [ + { + "recurring_interval": polar.ProductPriceRecurringInterval.MONTH, + "price_amount": 638424, + }, + ], + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/users/advertisements/{id}"]["patch"] + - target: $["paths"]["/v1/users/advertisements/"]["post"] update: x-codeSamples: - lang: python - label: update + label: create source: |- from polar import Polar @@ -167,16 +166,20 @@ actions: ) - res = s.users.advertisements.update(id="", user_advertisement_campaign_update={}) + res = s.users.advertisements.create(request={ + "image_url": "http://limp-pastry.org", + "text": "", + "link_url": "http://flashy-cartload.net", + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/products/{id}/benefits"]["post"] + - target: $["paths"]["/v1/users/orders/{id}"]["get"] update: x-codeSamples: - lang: python - label: update_benefits + label: get source: |- from polar import Polar @@ -185,20 +188,16 @@ actions: ) - res = s.products.update_benefits(id="", product_benefits_update={ - "benefits": [ - "", - ], - }) + res = s.users.orders.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/files/{id}"]["delete"] + - target: $["paths"]["/v1/organizations/{id}"]["patch"] update: x-codeSamples: - lang: python - label: delete + label: update source: |- from polar import Polar @@ -207,14 +206,16 @@ actions: ) - s.files.delete(id="") + res = s.organizations.update(id="", organization_update={}) - # Use the SDK ... - - target: $["paths"]["/v1/articles/{id}"]["get"] + if res is not None: + # handle response + pass + - target: $["paths"]["/v1/oauth2/introspect"]["post"] update: x-codeSamples: - lang: python - label: get + label: introspect_token source: |- from polar import Polar @@ -223,16 +224,20 @@ actions: ) - res = s.articles.retrieve(id="") + res = s.oauth2.introspect(request={ + "token": "", + "client_id": "", + "client_secret": "", + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/benefits/{id}"]["get"] + - target: $["paths"]["/v1/benefits/"]["post"] update: x-codeSamples: - lang: python - label: get + label: create source: |- from polar import Polar @@ -241,12 +246,18 @@ actions: ) - res = s.benefits.retrieve(id="") + res = s.benefits.create(request={ + "description": "Multi-tiered motivating standardization", + "properties": { + "guild_token": "", + "role_id": "", + }, + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/subscriptions/"]["post"] + - target: $["paths"]["/v1/checkouts/"]["post"] update: x-codeSamples: - lang: python @@ -259,19 +270,19 @@ actions: ) - res = s.subscriptions.create(request={ - "email": "Jena.Nienow28@yahoo.com", - "product_id": "", + res = s.checkouts.create(request={ + "product_price_id": "", + "success_url": "http://limp-pastry.org", }) if res is not None: # handle response pass - - target: $["paths"]["/v1/checkouts/"]["post"] + - target: $["paths"]["/v1/checkouts/{id}"]["get"] update: x-codeSamples: - lang: python - label: create + label: get source: |- from polar import Polar @@ -280,19 +291,16 @@ actions: ) - res = s.checkouts.create(request={ - "product_price_id": "", - "success_url": "http://limp-pastry.org", - }) + res = s.checkouts.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/metrics/limits"]["get"] + - target: $["paths"]["/v1/users/benefits/{id}"]["get"] update: x-codeSamples: - lang: python - label: limits + label: get source: |- from polar import Polar @@ -301,16 +309,16 @@ actions: ) - res = s.metrics.limits() + res = s.users.benefits.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/users/advertisements/"]["post"] + - target: $["paths"]["/v1/subscriptions/import"]["post"] update: x-codeSamples: - lang: python - label: create + label: import source: |- from polar import Polar @@ -319,20 +327,22 @@ actions: ) - res = s.users.advertisements.create(request={ - "image_url": "http://limp-pastry.org", - "text": "", - "link_url": "http://flashy-cartload.net", + res = s.subscriptions.import_subscriptions(request={ + "file": { + "file_name": "your_file_here", + "content": open("", "rb"), + }, + "organization_id": "", }) if res is not None: # handle response pass - - target: $["paths"]["/v1/articles/"]["post"] + - target: $["paths"]["/v1/subscriptions/export"]["get"] update: x-codeSamples: - lang: python - label: create + label: export source: |- from polar import Polar @@ -341,18 +351,16 @@ actions: ) - res = s.articles.create(request={ - "title": "", - }) + res = s.subscriptions.export() if res is not None: # handle response pass - - target: $["paths"]["/v1/oauth2/register/{client_id}"]["get"] + - target: $["paths"]["/v1/oauth2/revoke"]["post"] update: x-codeSamples: - lang: python - label: get_client + label: revoke_token source: |- from polar import Polar @@ -361,16 +369,20 @@ actions: ) - res = s.oauth2.clients.retrieve(client_id="") + res = s.oauth2.revoke(request={ + "token": "", + "client_id": "", + "client_secret": "", + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/benefits/"]["post"] + - target: $["paths"]["/v1/organizations/"]["get"] update: x-codeSamples: - lang: python - label: create + label: list source: |- from polar import Polar @@ -379,24 +391,21 @@ actions: ) - res = s.benefits.create(request={ - "description": "Multi-tiered motivating standardization", - "properties": { - "guild_token": "", - "role_id": "", - }, - }) + res = s.organizations.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/products/"]["post"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/external_organizations/"]["get"] update: x-codeSamples: - lang: python - label: create + label: list source: |- - import polar from polar import Polar s = Polar( @@ -404,24 +413,20 @@ actions: ) - res = s.products.create(request={ - "name": "", - "prices": [ - { - "recurring_interval": polar.ProductPriceRecurringInterval.MONTH, - "price_amount": 638424, - }, - ], - }) + res = s.external_organizations.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/products/{id}"]["patch"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/articles/{id}/preview"]["post"] update: x-codeSamples: - lang: python - label: update + label: preview source: |- from polar import Polar @@ -430,16 +435,18 @@ actions: ) - res = s.products.update(id="", product_update={}) + res = s.articles.preview(id="", article_preview={ + "email": "Eileen56@yahoo.com", + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/users/orders/{id}"]["get"] + - target: $["paths"]["/v1/oauth2/register/{client_id}"]["put"] update: x-codeSamples: - lang: python - label: get + label: update_client source: |- from polar import Polar @@ -448,16 +455,22 @@ actions: ) - res = s.users.orders.retrieve(id="") + res = s.oauth2.clients.update(client_id="", o_auth2_client_configuration_update={ + "redirect_uris": [ + "https://alarming-nondisclosure.com", + ], + "client_name": "", + "client_id": "", + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/users/orders/{id}/invoice"]["get"] + - target: $["paths"]["/v1/oauth2/register/{client_id}"]["delete"] update: x-codeSamples: - lang: python - label: invoice + label: delete_client source: |- from polar import Polar @@ -466,16 +479,16 @@ actions: ) - res = s.users.orders.invoice(id="") + res = s.oauth2.clients.delete(client_id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/files/{id}/uploaded"]["post"] + - target: $["paths"]["/v1/files/{id}"]["patch"] update: x-codeSamples: - lang: python - label: uploaded + label: update source: |- from polar import Polar @@ -484,26 +497,16 @@ actions: ) - res = s.files.uploaded(id="", file_upload_completed={ - "id": "", - "path": "/sys", - "parts": [ - { - "number": 241210, - "checksum_etag": "", - "checksum_sha256_base64": "", - }, - ], - }) + res = s.files.update(id="", file_patch={}) if res is not None: # handle response pass - - target: $["paths"]["/v1/orders/{id}/invoice"]["get"] + - target: $["paths"]["/v1/repositories/{id}"]["patch"] update: x-codeSamples: - lang: python - label: invoice + label: update source: |- from polar import Polar @@ -512,16 +515,16 @@ actions: ) - res = s.orders.invoice(id="") + res = s.repositories.update(id="", repository_update={}) if res is not None: # handle response pass - - target: $["paths"]["/v1/files/"]["get"] + - target: $["paths"]["/v1/articles/{id}/receivers"]["get"] update: x-codeSamples: - lang: python - label: list + label: receivers source: |- from polar import Polar @@ -530,20 +533,16 @@ actions: ) - res = s.files.list() + res = s.articles.receivers(id="") if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/subscriptions/import"]["post"] + # handle response + pass + - target: $["paths"]["/v1/articles/{id}/send"]["post"] update: x-codeSamples: - lang: python - label: import + label: send source: |- from polar import Polar @@ -552,22 +551,16 @@ actions: ) - res = s.subscriptions.import_subscriptions(request={ - "file": { - "file_name": "your_file_here", - "content": open("", "rb"), - }, - "organization_id": "", - }) + res = s.articles.send(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/articles/{id}/receivers"]["get"] + - target: $["paths"]["/v1/files/"]["post"] update: x-codeSamples: - lang: python - label: receivers + label: create source: |- from polar import Polar @@ -576,16 +569,29 @@ actions: ) - res = s.articles.receivers(id="") + res = s.files.create(request={ + "name": "", + "mime_type": "", + "size": 489382, + "upload": { + "parts": [ + { + "number": 638424, + "chunk_start": 859213, + "chunk_end": 417458, + }, + ], + }, + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/oauth2/register/{client_id}"]["put"] + - target: $["paths"]["/v1/files/{id}"]["delete"] update: x-codeSamples: - lang: python - label: update_client + label: delete source: |- from polar import Polar @@ -594,22 +600,14 @@ actions: ) - res = s.oauth2.clients.update(client_id="", o_auth2_client_configuration_update={ - "redirect_uris": [ - "https://alarming-nondisclosure.com", - ], - "client_name": "", - "client_id": "", - }) + s.files.delete(id="") - if res is not None: - # handle response - pass - - target: $["paths"]["/v1/benefits/{id}"]["patch"] + # Use the SDK ... + - target: $["paths"]["/v1/users/orders/"]["get"] update: x-codeSamples: - lang: python - label: update + label: list source: |- from polar import Polar @@ -618,16 +616,20 @@ actions: ) - res = s.benefits.update(id="", request_body={}) + res = s.users.orders.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/files/{id}"]["patch"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/users/orders/{id}/invoice"]["get"] update: x-codeSamples: - lang: python - label: update + label: invoice source: |- from polar import Polar @@ -636,16 +638,16 @@ actions: ) - res = s.files.update(id="", file_patch={}) + res = s.users.orders.invoice(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/organizations/"]["post"] + - target: $["paths"]["/v1/benefits/{id}/grants"]["get"] update: x-codeSamples: - lang: python - label: create + label: grants source: |- from polar import Polar @@ -654,19 +656,20 @@ actions: ) - res = s.organizations.create(request={ - "name": "", - "slug": "", - }) + res = s.benefits.grants(id="") if res is not None: - # handle response - pass - - target: $["paths"]["/v1/organizations/{id}"]["patch"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/orders/"]["get"] update: x-codeSamples: - lang: python - label: update + label: list source: |- from polar import Polar @@ -675,16 +678,20 @@ actions: ) - res = s.organizations.update(id="", organization_update={}) + res = s.orders.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/oauth2/revoke"]["post"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/orders/{id}/invoice"]["get"] update: x-codeSamples: - lang: python - label: revoke_token + label: invoice source: |- from polar import Polar @@ -693,16 +700,12 @@ actions: ) - res = s.oauth2.revoke(request={ - "token": "", - "client_id": "", - "client_secret": "", - }) + res = s.orders.invoice(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/products/"]["get"] + - target: $["paths"]["/v1/users/benefits/"]["get"] update: x-codeSamples: - lang: python @@ -715,7 +718,7 @@ actions: ) - res = s.products.list() + res = s.users.benefits.list() if res is not None: while True: @@ -724,11 +727,11 @@ actions: res = res.Next() if res is None: break - - target: $["paths"]["/v1/advertisements/"]["get"] + - target: $["paths"]["/v1/users/subscriptions/"]["post"] update: x-codeSamples: - lang: python - label: list + label: create source: |- from polar import Polar @@ -737,20 +740,18 @@ actions: ) - res = s.advertisements.list(benefit_id="") + res = s.users.subscriptions.create(request={ + "product_id": "", + }) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/advertisements/{id}"]["get"] + # handle response + pass + - target: $["paths"]["/v1/users/advertisements/{id}"]["delete"] update: x-codeSamples: - lang: python - label: get + label: delete source: |- from polar import Polar @@ -759,16 +760,16 @@ actions: ) - res = s.advertisements.retrieve(id="") + res = s.users.advertisements.delete(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/oauth2/introspect"]["post"] + - target: $["paths"]["/v1/articles/"]["post"] update: x-codeSamples: - lang: python - label: introspect_token + label: create source: |- from polar import Polar @@ -777,20 +778,18 @@ actions: ) - res = s.oauth2.introspect(request={ - "token": "", - "client_id": "", - "client_secret": "", + res = s.articles.create(request={ + "title": "", }) if res is not None: # handle response pass - - target: $["paths"]["/v1/users/subscriptions/{id}"]["delete"] + - target: $["paths"]["/v1/advertisements/{id}"]["get"] update: x-codeSamples: - lang: python - label: cancel + label: get source: |- from polar import Polar @@ -799,12 +798,30 @@ actions: ) - res = s.users.subscriptions.cancel(id="") + res = s.advertisements.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/articles/"]["get"] + - target: $["paths"]["/v1/products/{id}"]["get"] + update: + x-codeSamples: + - lang: python + label: get + source: |- + from polar import Polar + + s = Polar( + access_token="", + ) + + + res = s.products.retrieve(id="") + + if res is not None: + # handle response + pass + - target: $["paths"]["/v1/users/subscriptions/"]["get"] update: x-codeSamples: - lang: python @@ -817,7 +834,7 @@ actions: ) - res = s.articles.list() + res = s.users.subscriptions.list() if res is not None: while True: @@ -826,11 +843,11 @@ actions: res = res.Next() if res is None: break - - target: $["paths"]["/v1/orders/{id}"]["get"] + - target: $["paths"]["/v1/users/subscriptions/{id}"]["patch"] update: x-codeSamples: - lang: python - label: get + label: update source: |- from polar import Polar @@ -839,12 +856,14 @@ actions: ) - res = s.orders.retrieve(id="") + res = s.users.subscriptions.update(id="", user_subscription_update={ + "product_price_id": "", + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/checkouts/{id}"]["get"] + - target: $["paths"]["/v1/repositories/{id}"]["get"] update: x-codeSamples: - lang: python @@ -857,12 +876,12 @@ actions: ) - res = s.checkouts.retrieve(id="") + res = s.repositories.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/users/advertisements/"]["get"] + - target: $["paths"]["/v1/subscriptions/"]["get"] update: x-codeSamples: - lang: python @@ -875,7 +894,7 @@ actions: ) - res = s.users.advertisements.list() + res = s.subscriptions.list() if res is not None: while True: @@ -884,11 +903,11 @@ actions: res = res.Next() if res is None: break - - target: $["paths"]["/v1/oauth2/"]["get"] + - target: $["paths"]["/v1/articles/{id}"]["patch"] update: x-codeSamples: - lang: python - label: list + label: update source: |- from polar import Polar @@ -897,20 +916,16 @@ actions: ) - res = s.oauth2.clients.list() + res = s.articles.update(id="", article_update={}) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/users/benefits/"]["get"] + # handle response + pass + - target: $["paths"]["/v1/oauth2/register/{client_id}"]["get"] update: x-codeSamples: - lang: python - label: list + label: get_client source: |- from polar import Polar @@ -919,20 +934,16 @@ actions: ) - res = s.users.benefits.list() + res = s.oauth2.clients.retrieve(client_id="") if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/repositories/{id}"]["patch"] + # handle response + pass + - target: $["paths"]["/v1/benefits/"]["get"] update: x-codeSamples: - lang: python - label: update + label: list source: |- from polar import Polar @@ -941,16 +952,20 @@ actions: ) - res = s.repositories.update(id="", repository_update={}) + res = s.benefits.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/articles/{id}"]["patch"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/users/subscriptions/{id}"]["get"] update: x-codeSamples: - lang: python - label: update + label: get source: |- from polar import Polar @@ -959,16 +974,16 @@ actions: ) - res = s.articles.update(id="", article_update={}) + res = s.users.subscriptions.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/oauth2/userinfo"]["get"] + - target: $["paths"]["/v1/organizations/{id}"]["get"] update: x-codeSamples: - lang: python - label: userinfo + label: get source: |- from polar import Polar @@ -977,16 +992,16 @@ actions: ) - res = s.oauth2.userinfo() + res = s.organizations.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/oauth2/register"]["post"] + - target: $["paths"]["/v1/subscriptions/"]["post"] update: x-codeSamples: - lang: python - label: create_client + label: create source: |- from polar import Polar @@ -995,24 +1010,20 @@ actions: ) - res = s.oauth2.clients.create(request={ - "redirect_uris": [ - "http://limp-pastry.org", - ], - "client_name": "", + res = s.subscriptions.create(request={ + "email": "Jena.Nienow28@yahoo.com", + "product_id": "", }) if res is not None: # handle response pass - - target: $["paths"]["/v1/metrics/"]["get"] + - target: $["paths"]["/v1/articles/{id}"]["get"] update: x-codeSamples: - lang: python label: get source: |- - import dateutil.parser - import polar from polar import Polar s = Polar( @@ -1020,16 +1031,16 @@ actions: ) - res = s.metrics.retrieve(start_date=dateutil.parser.parse("2023-02-11").date(), end_date=dateutil.parser.parse("2024-11-01").date(), interval=polar.Interval.HOUR) + res = s.articles.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/users/subscriptions/"]["post"] + - target: $["paths"]["/v1/oauth2/userinfo"]["get"] update: x-codeSamples: - lang: python - label: create + label: userinfo source: |- from polar import Polar @@ -1038,18 +1049,16 @@ actions: ) - res = s.users.subscriptions.create(request={ - "product_id": "", - }) + res = s.oauth2.userinfo() if res is not None: # handle response pass - - target: $["paths"]["/v1/users/downloadables/"]["get"] + - target: $["paths"]["/v1/products/{id}/benefits"]["post"] update: x-codeSamples: - lang: python - label: list + label: update_benefits source: |- from polar import Polar @@ -1058,20 +1067,20 @@ actions: ) - res = s.users.downloadables.list() + res = s.products.update_benefits(id="", product_benefits_update={ + "benefits": [ + "", + ], + }) if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/benefits/{id}"]["delete"] + # handle response + pass + - target: $["paths"]["/v1/orders/{id}"]["get"] update: x-codeSamples: - lang: python - label: delete + label: get source: |- from polar import Polar @@ -1080,15 +1089,19 @@ actions: ) - s.benefits.delete(id="") + res = s.orders.retrieve(id="") - # Use the SDK ... - - target: $["paths"]["/v1/repositories/{id}"]["get"] + if res is not None: + # handle response + pass + - target: $["paths"]["/v1/metrics/"]["get"] update: x-codeSamples: - lang: python label: get source: |- + import dateutil.parser + import polar from polar import Polar s = Polar( @@ -1096,16 +1109,16 @@ actions: ) - res = s.repositories.retrieve(id="") + res = s.metrics.retrieve(start_date=dateutil.parser.parse("2023-02-11").date(), end_date=dateutil.parser.parse("2024-11-01").date(), interval=polar.Interval.HOUR) if res is not None: # handle response pass - - target: $["paths"]["/v1/oauth2/token"]["post"] + - target: $["paths"]["/v1/users/subscriptions/{id}"]["delete"] update: x-codeSamples: - lang: python - label: request_token + label: cancel source: |- from polar import Polar @@ -1114,21 +1127,16 @@ actions: ) - res = s.oauth2.token(request={ - "client_id": "", - "client_secret": "", - "code": "", - "redirect_uri": "http://multicolored-chivalry.name", - }) + res = s.users.subscriptions.cancel(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/external_organizations/"]["get"] + - target: $["paths"]["/v1/users/downloadables/{token}"]["get"] update: x-codeSamples: - lang: python - label: list + label: get source: |- from polar import Polar @@ -1137,20 +1145,16 @@ actions: ) - res = s.external_organizations.list() + res = s.users.downloadables.retrieve(token="") if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/repositories/"]["get"] + # handle response + pass + - target: $["paths"]["/v1/benefits/{id}"]["delete"] update: x-codeSamples: - lang: python - label: list + label: delete source: |- from polar import Polar @@ -1159,20 +1163,14 @@ actions: ) - res = s.repositories.list() - - if res is not None: - while True: - # handle items + s.benefits.delete(id="") - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/subscriptions/export"]["get"] + # Use the SDK ... + - target: $["paths"]["/v1/users/advertisements/{id}"]["get"] update: x-codeSamples: - lang: python - label: export + label: get source: |- from polar import Polar @@ -1181,16 +1179,16 @@ actions: ) - res = s.subscriptions.export() + res = s.users.advertisements.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/articles/{id}/send"]["post"] + - target: $["paths"]["/v1/articles/"]["get"] update: x-codeSamples: - lang: python - label: send + label: list source: |- from polar import Polar @@ -1199,16 +1197,20 @@ actions: ) - res = s.articles.send(id="") + res = s.articles.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/oauth2/register/{client_id}"]["delete"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/files/{id}/uploaded"]["post"] update: x-codeSamples: - lang: python - label: delete_client + label: uploaded source: |- from polar import Polar @@ -1217,12 +1219,22 @@ actions: ) - res = s.oauth2.clients.delete(client_id="") + res = s.files.uploaded(id="", file_upload_completed={ + "id": "", + "path": "/sys", + "parts": [ + { + "number": 241210, + "checksum_etag": "", + "checksum_sha256_base64": "", + }, + ], + }) if res is not None: # handle response pass - - target: $["paths"]["/v1/benefits/"]["get"] + - target: $["paths"]["/v1/repositories/"]["get"] update: x-codeSamples: - lang: python @@ -1235,7 +1247,7 @@ actions: ) - res = s.benefits.list() + res = s.repositories.list() if res is not None: while True: @@ -1244,11 +1256,11 @@ actions: res = res.Next() if res is None: break - - target: $["paths"]["/v1/users/subscriptions/{id}"]["patch"] + - target: $["paths"]["/v1/users/advertisements/{id}/enable"]["post"] update: x-codeSamples: - lang: python - label: update + label: enable source: |- from polar import Polar @@ -1257,18 +1269,16 @@ actions: ) - res = s.users.subscriptions.update(id="", user_subscription_update={ - "product_price_id": "", + s.users.advertisements.enable(id="", user_advertisement_campaign_enable={ + "benefit_id": "", }) - if res is not None: - # handle response - pass - - target: $["paths"]["/v1/users/advertisements/{id}/enable"]["post"] + # Use the SDK ... + - target: $["paths"]["/v1/articles/{id}"]["delete"] update: x-codeSamples: - lang: python - label: enable + label: delete source: |- from polar import Polar @@ -1277,16 +1287,14 @@ actions: ) - s.users.advertisements.enable(id="", user_advertisement_campaign_enable={ - "benefit_id": "", - }) + s.articles.delete(id="") # Use the SDK ... - - target: $["paths"]["/v1/benefits/{id}/grants"]["get"] + - target: $["paths"]["/v1/advertisements/"]["get"] update: x-codeSamples: - lang: python - label: grants + label: list source: |- from polar import Polar @@ -1295,7 +1303,7 @@ actions: ) - res = s.benefits.grants(id="") + res = s.advertisements.list(benefit_id="") if res is not None: while True: @@ -1304,7 +1312,7 @@ actions: res = res.Next() if res is None: break - - target: $["paths"]["/v1/products/{id}"]["get"] + - target: $["paths"]["/v1/benefits/{id}"]["get"] update: x-codeSamples: - lang: python @@ -1317,34 +1325,16 @@ actions: ) - res = s.products.retrieve(id="") - - if res is not None: - # handle response - pass - - target: $["paths"]["/v1/users/advertisements/{id}"]["delete"] - update: - x-codeSamples: - - lang: python - label: delete - source: |- - from polar import Polar - - s = Polar( - access_token="", - ) - - - res = s.users.advertisements.delete(id="") + res = s.benefits.retrieve(id="") if res is not None: # handle response pass - - target: $["paths"]["/v1/users/downloadables/{token}"]["get"] + - target: $["paths"]["/v1/users/advertisements/{id}"]["patch"] update: x-codeSamples: - lang: python - label: get + label: update source: |- from polar import Polar @@ -1353,12 +1343,12 @@ actions: ) - res = s.users.downloadables.retrieve(token="") + res = s.users.advertisements.update(id="", user_advertisement_campaign_update={}) if res is not None: # handle response pass - - target: $["paths"]["/v1/subscriptions/"]["get"] + - target: $["paths"]["/v1/oauth2/"]["get"] update: x-codeSamples: - lang: python @@ -1371,7 +1361,7 @@ actions: ) - res = s.subscriptions.list() + res = s.oauth2.clients.list() if res is not None: while True: @@ -1380,11 +1370,11 @@ actions: res = res.Next() if res is None: break - - target: $["paths"]["/v1/articles/{id}"]["delete"] + - target: $["paths"]["/v1/oauth2/register"]["post"] update: x-codeSamples: - lang: python - label: delete + label: create_client source: |- from polar import Polar @@ -1393,14 +1383,21 @@ actions: ) - s.articles.delete(id="") + res = s.oauth2.clients.create(request={ + "redirect_uris": [ + "http://limp-pastry.org", + ], + "client_name": "", + }) - # Use the SDK ... - - target: $["paths"]["/v1/articles/{id}/preview"]["post"] + if res is not None: + # handle response + pass + - target: $["paths"]["/v1/files/"]["get"] update: x-codeSamples: - lang: python - label: preview + label: list source: |- from polar import Polar @@ -1409,18 +1406,20 @@ actions: ) - res = s.articles.preview(id="", article_preview={ - "email": "Eileen56@yahoo.com", - }) + res = s.files.list() if res is not None: - # handle response - pass - - target: $["paths"]["/v1/users/orders/"]["get"] + while True: + # handle items + + res = res.Next() + if res is None: + break + - target: $["paths"]["/v1/metrics/limits"]["get"] update: x-codeSamples: - lang: python - label: list + label: limits source: |- from polar import Polar @@ -1429,20 +1428,16 @@ actions: ) - res = s.users.orders.list() + res = s.metrics.limits() if res is not None: - while True: - # handle items - - res = res.Next() - if res is None: - break - - target: $["paths"]["/v1/users/subscriptions/{id}"]["get"] + # handle response + pass + - target: $["paths"]["/v1/oauth2/token"]["post"] update: x-codeSamples: - lang: python - label: get + label: request_token source: |- from polar import Polar @@ -1451,7 +1446,12 @@ actions: ) - res = s.users.subscriptions.retrieve(id="") + res = s.oauth2.token(request={ + "client_id": "", + "client_secret": "", + "code": "", + "redirect_uri": "http://multicolored-chivalry.name", + }) if res is not None: # handle response diff --git a/pyproject.toml b/pyproject.toml index 50992cb..d0ac270 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polar" -version = "0.1.2" +version = "0.1.3" description = "Polar SDK for Python" authors = ["Polar",] readme = "README-PYPI.md" diff --git a/src/polar/sdkconfiguration.py b/src/polar/sdkconfiguration.py index f0f2ad2..2f1b1d5 100644 --- a/src/polar/sdkconfiguration.py +++ b/src/polar/sdkconfiguration.py @@ -26,9 +26,9 @@ class SDKConfiguration: server_idx: Optional[int] = 0 language: str = "python" openapi_doc_version: str = "0.1.0" - sdk_version: str = "0.1.2" + sdk_version: str = "0.1.3" gen_version: str = "2.404.11" - user_agent: str = "speakeasy-sdk/python 0.1.2 2.404.11 0.1.0 polar" + user_agent: str = "speakeasy-sdk/python 0.1.3 2.404.11 0.1.0 polar" retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None