Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.477.2
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Jan 30, 2025
1 parent 17eed02 commit cac11c1
Show file tree
Hide file tree
Showing 711 changed files with 8,531 additions and 6,642 deletions.
783 changes: 435 additions & 348 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: true
php:
version: 0.0.2
version: 0.0.3
additionalDependencies:
autoload: {}
autoload-dev: {}
Expand Down
19 changes: 13 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
speakeasyVersion: 1.456.1
speakeasyVersion: 1.477.2
sources:
Polar-OAS:
sourceNamespace: polar-oas
sourceRevisionDigest: sha256:1e9d93d2659b8cb752ec5172bd0652070c9eb56a8299f0c4bf2de2a5c7a22318
sourceBlobDigest: sha256:2fcb4a497110dfacf53652f840b4586fd532f15ddfa11dc8329db9987c54371a
sourceRevisionDigest: sha256:d12dcf7e51875b571de3328c1d5a9164c1bf73abf8bf81815187a736b6457c14
sourceBlobDigest: sha256:af17895c9591a019fcc82332db823c59ef4d18ba276fff2ff3a718d6739e383f
tags:
- latest
- speakeasy-sdk-regen-1738196173
- 0.1.0
targets:
polar:
source: Polar-OAS
sourceNamespace: polar-oas
sourceRevisionDigest: sha256:1e9d93d2659b8cb752ec5172bd0652070c9eb56a8299f0c4bf2de2a5c7a22318
sourceBlobDigest: sha256:2fcb4a497110dfacf53652f840b4586fd532f15ddfa11dc8329db9987c54371a
sourceRevisionDigest: sha256:d12dcf7e51875b571de3328c1d5a9164c1bf73abf8bf81815187a736b6457c14
sourceBlobDigest: sha256:af17895c9591a019fcc82332db823c59ef4d18ba276fff2ff3a718d6739e383f
codeSamplesNamespace: polar-api-php-code-samples
codeSamplesRevisionDigest: sha256:60f7723c2f70363500167accfeb9e53c99c04ed68a7a807f42bce731c7fd5481
codeSamplesRevisionDigest: sha256:5b08976b728293f56e85c152ccb57551de38145a05e8a70d4e58efb538d180cd
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand All @@ -33,7 +34,13 @@ workflow:
polar:
target: php
source: Polar-OAS
publish:
packagist:
username: polar
token: $packagist_token
codeSamples:
registry:
location: registry.speakeasyapi.dev/polar/polar/polar-api-php-code-samples
labelOverride:
fixedValue: PHP (SDK)
blocking: false
4 changes: 2 additions & 2 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ targets:
username: polar
token: $packagist_token
codeSamples:
labelOverride:
fixedValue: PHP (SDK)
registry:
location: registry.speakeasyapi.dev/polar/polar/polar-api-php-code-samples
labelOverride:
fixedValue: PHP (SDK)
blocking: false
150 changes: 96 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Developer-friendly & type-safe Php SDK specifically catered to leverage *polar-s

Polar API: Polar HTTP and Webhooks API

Read the docs at https://docs.polar.sh/api
Read the docs at https://docs.polar.sh/api-reference
<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
Expand All @@ -28,6 +28,7 @@ Read the docs at https://docs.polar.sh/api
* [polar-sh/sdk](#polar-shsdk)
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Authentication](#authentication)
* [Available Resources and Operations](#available-resources-and-operations)
* [Pagination](#pagination)
* [Error Handling](#error-handling)
Expand All @@ -43,26 +44,9 @@ Read the docs at https://docs.polar.sh/api

The SDK relies on [Composer](https://getcomposer.org/) to manage its dependencies.

To install the SDK first add the below to your `composer.json` file:

```json
{
"repositories": [
{
"type": "github",
"url": "<UNSET>.git"
}
],
"require": {
"polar-sh/sdk": "*"
}
}
```

Then run the following command:

To install the SDK and add it as a dependency to an existing `composer.json` file:
```bash
composer update
composer require "polar-sh/sdk"
```
<!-- End SDK Installation [installation] -->

Expand All @@ -84,12 +68,13 @@ $sdk = Polar\Polar::builder()->build();

$request = new Components\WebhookCheckoutCreatedPayload(
data: new Components\Checkout(
createdAt: Utils\Utils::parseDateTime('2024-11-12T14:26:42.882Z'),
createdAt: Utils\Utils::parseDateTime('2025-11-12T14:26:42.882Z'),
id: '<value>',
paymentProcessor: Components\PaymentProcessor::Stripe,
status: Components\CheckoutStatus::Confirmed,
clientSecret: '<value>',
url: 'https://fragrant-freezing.com',
expiresAt: Utils\Utils::parseDateTime('2022-04-01T05:43:33.513Z'),
expiresAt: Utils\Utils::parseDateTime('2023-04-01T05:43:33.513Z'),
successUrl: 'https://lined-privilege.biz/',
productId: '<value>',
productPriceId: '<value>',
Expand All @@ -99,41 +84,43 @@ $request = new Components\WebhookCheckoutCreatedPayload(
isPaymentRequired: false,
isPaymentSetupRequired: false,
isPaymentFormRequired: false,
paymentProcessorMetadata: new Components\PaymentProcessorMetadata(),
paymentProcessorMetadata: [
'key' => '<value>',
],
metadata: [
'key' => 962818,
],
product: new Components\CheckoutProduct(
createdAt: Utils\Utils::parseDateTime('2022-01-08T00:22:16.025Z'),
createdAt: Utils\Utils::parseDateTime('2023-01-08T00:22:16.025Z'),
id: '<value>',
name: '<value>',
isRecurring: false,
isArchived: false,
organizationId: '<value>',
prices: [
new Components\ProductPriceRecurringCustom(
createdAt: Utils\Utils::parseDateTime('2022-08-19T22:18:44.316Z'),
createdAt: Utils\Utils::parseDateTime('2023-08-19T22:18:44.316Z'),
id: '<value>',
isArchived: false,
productId: '<value>',
priceCurrency: '<value>',
recurringInterval: Components\SubscriptionRecurringInterval::Month,
modifiedAt: Utils\Utils::parseDateTime('2024-04-20T22:18:45.464Z'),
modifiedAt: Utils\Utils::parseDateTime('2025-04-20T22:18:45.464Z'),
minimumAmount: 598949,
maximumAmount: 500372,
presetAmount: 688646,
),
],
benefits: [
new Components\BenefitBase(
createdAt: Utils\Utils::parseDateTime('2024-07-22T12:18:02.066Z'),
createdAt: Utils\Utils::parseDateTime('2025-07-22T12:18:02.066Z'),
id: '<value>',
type: Components\BenefitType::Downloadables,
description: 'rotten relative for embarrassment untidy long-term near honestly separate',
selectable: false,
deletable: false,
organizationId: '<value>',
modifiedAt: Utils\Utils::parseDateTime('2024-01-10T13:42:03.592Z'),
modifiedAt: Utils\Utils::parseDateTime('2025-01-09T13:42:03.592Z'),
),
],
medias: [
Expand All @@ -145,33 +132,33 @@ $request = new Components\WebhookCheckoutCreatedPayload(
mimeType: '<value>',
size: 879649,
isUploaded: false,
createdAt: Utils\Utils::parseDateTime('2024-09-12T19:41:14.261Z'),
createdAt: Utils\Utils::parseDateTime('2025-09-12T19:41:14.261Z'),
sizeReadable: '<value>',
publicUrl: 'https://rectangular-worth.info/',
storageVersion: '<value>',
checksumEtag: '<value>',
checksumSha256Base64: '<value>',
checksumSha256Hex: '<value>',
lastModifiedAt: Utils\Utils::parseDateTime('2024-06-29T02:23:28.661Z'),
lastModifiedAt: Utils\Utils::parseDateTime('2025-06-29T02:23:28.661Z'),
version: '<value>',
),
],
modifiedAt: Utils\Utils::parseDateTime('2023-05-08T04:30:09.331Z'),
modifiedAt: Utils\Utils::parseDateTime('2024-05-07T04:30:09.331Z'),
description: 'provided publicize astride oof mockingly if opposite coagulate pro',
),
productPrice: new Components\ProductPriceRecurringFree(
createdAt: Utils\Utils::parseDateTime('2023-12-29T06:38:59.235Z'),
createdAt: Utils\Utils::parseDateTime('2024-12-28T06:38:59.235Z'),
id: '<value>',
isArchived: false,
productId: '<value>',
recurringInterval: Components\SubscriptionRecurringInterval::Year,
modifiedAt: Utils\Utils::parseDateTime('2022-03-21T13:22:46.065Z'),
modifiedAt: Utils\Utils::parseDateTime('2023-03-21T13:22:46.065Z'),
),
attachedCustomFields: [
new Components\AttachedCustomField(
customFieldId: '<value>',
customField: new Components\CustomFieldNumber(
createdAt: Utils\Utils::parseDateTime('2024-09-13T23:13:23.872Z'),
createdAt: Utils\Utils::parseDateTime('2025-09-13T23:13:23.872Z'),
id: '<value>',
metadata: [
'key' => false,
Expand All @@ -180,7 +167,7 @@ $request = new Components\WebhookCheckoutCreatedPayload(
name: '<value>',
organizationId: '<value>',
properties: new Components\CustomFieldNumberProperties(),
modifiedAt: Utils\Utils::parseDateTime('2024-03-11T01:07:03.723Z'),
modifiedAt: Utils\Utils::parseDateTime('2025-03-11T01:07:03.723Z'),
),
order: 169862,
required: false,
Expand All @@ -189,7 +176,7 @@ $request = new Components\WebhookCheckoutCreatedPayload(
customerMetadata: [
'key' => '<value>',
],
modifiedAt: Utils\Utils::parseDateTime('2022-09-27T02:51:25.666Z'),
modifiedAt: Utils\Utils::parseDateTime('2023-09-27T02:51:25.666Z'),
embedOrigin: '<value>',
amount: 587344,
taxAmount: 753909,
Expand All @@ -199,17 +186,17 @@ $request = new Components\WebhookCheckoutCreatedPayload(
discountId: '<value>',
customerId: '<value>',
customerName: '<value>',
customerEmail: '[email protected]',
customerEmail: '<value>',
customerIpAddress: '<value>',
customerBillingAddress: new Components\Address(
country: 'Northern Mariana Islands',
country: 'British Indian Ocean Territory (Chagos Archipelago)',
),
customerTaxId: '<id>',
discount: new Components\CheckoutDiscountPercentageRepeatDuration(
duration: Components\DiscountDuration::Forever,
durationInMonths: 496211,
type: Components\DiscountType::Percentage,
basisPoints: 741459,
duration: Components\DiscountDuration::Repeating,
durationInMonths: 918364,
type: Components\DiscountType::Fixed,
basisPoints: 271748,
id: '<value>',
name: '<value>',
code: '<value>',
Expand All @@ -228,6 +215,47 @@ if ($response->any !== null) {
```
<!-- End SDK Example Usage [usage] -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name | Type | Scheme |
| ------------- | ---- | ----------- |
| `accessToken` | http | HTTP Bearer |

To authenticate with the API the `accessToken` parameter must be set when initializing the SDK. For example:
```php
declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();

$request = new Operations\ExternalOrganizationsListRequest();

$responses = $sdk->externalOrganizations->list(
request: $request
);


foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
```
<!-- End Authentication [security] -->

<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

Expand Down Expand Up @@ -404,6 +432,11 @@ if ($response->any !== null) {
* [update](docs/sdks/products/README.md#update) - Update Product
* [updateBenefits](docs/sdks/products/README.md#updatebenefits) - Update Product Benefits

### [refunds](docs/sdks/refunds/README.md)

* [create](docs/sdks/refunds/README.md#create) - Create Refund
* [list](docs/sdks/refunds/README.md#list) - List Refunds

### [repositories](docs/sdks/repositories/README.md)

* [get](docs/sdks/repositories/README.md#get) - Get Repository
Expand All @@ -413,7 +446,10 @@ if ($response->any !== null) {
### [subscriptions](docs/sdks/subscriptions/README.md)

* [export](docs/sdks/subscriptions/README.md#export) - Export Subscriptions
* [get](docs/sdks/subscriptions/README.md#get) - Get Subscription
* [list](docs/sdks/subscriptions/README.md#list) - List Subscriptions
* [revoke](docs/sdks/subscriptions/README.md#revoke) - Revoke Subscription
* [update](docs/sdks/subscriptions/README.md#update) - Update Subscription

</details>
<!-- End Available Resources and Operations [operations] -->
Expand All @@ -433,9 +469,11 @@ require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();

$request = new Operations\ExternalOrganizationsListRequest();

Expand Down Expand Up @@ -483,9 +521,11 @@ require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();

try {
$request = new Operations\ExternalOrganizationsListRequest();
Expand Down Expand Up @@ -531,11 +571,12 @@ require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()
->setServer("sandbox")
->setSecurity($security)->build();
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();

$request = new Operations\ExternalOrganizationsListRequest();

Expand All @@ -562,11 +603,12 @@ require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()
->setServerURL('https://api.polar.sh')
->setSecurity($security)->build();
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();

$request = new Operations\ExternalOrganizationsListRequest();

Expand Down
Loading

0 comments on commit cac11c1

Please sign in to comment.