From f149888ec6c0482e228af98d5cbb6071fa4b18d3 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 18 Dec 2024 00:21:22 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.456.0 --- .speakeasy/gen.lock | 19 +- .speakeasy/gen.yaml | 7 +- .speakeasy/workflow.lock | 14 +- README.md | 102 +++-- RELEASES.md | 12 +- codeSamples.yaml | 4 +- docs/Models/Components/WorkspaceSchema.md | 5 +- docs/sdks/customers/README.md | 90 ++--- docs/sdks/domains/README.md | 91 ++--- docs/sdks/links/README.md | 265 ++++++------- docs/sdks/tags/README.md | 64 +-- docs/sdks/track/README.md | 62 +-- src/Customers.php | 110 +++--- src/Domains.php | 190 ++++----- src/Hooks/AfterErrorContext.php | 14 + src/Hooks/BeforeRequestContext.php | 14 + src/Hooks/Credentials.php | 24 ++ src/Hooks/HookContext.php | 13 + src/Hooks/Session.php | 37 ++ src/Hooks/TokenResponse.php | 17 + src/Links.php | 368 +++++++++--------- src/Models/Components/Click.php | 14 +- src/Models/Components/ClickEvent.php | 16 +- src/Models/Components/Customer.php | 16 +- src/Models/Components/Data.php | 150 +++---- src/Models/Components/DomainSchema.php | 70 ++-- .../Components/LeadCreatedEventClick.php | 14 +- .../Components/LeadCreatedEventLink.php | 150 +++---- src/Models/Components/Link.php | 150 +++---- .../Components/LinkClickedEventClick.php | 14 +- .../Components/LinkClickedEventLink.php | 150 +++---- src/Models/Components/LinkSchema.php | 248 ++++++------ .../Components/SaleCreatedEventClick.php | 14 +- .../Components/SaleCreatedEventCustomer.php | 16 +- .../Components/SaleCreatedEventLink.php | 150 +++---- src/Models/Components/WorkspaceSchema.php | 114 ++---- .../Operations/BulkUpdateLinksRequestBody.php | 16 +- .../Operations/CreateCustomerRequestBody.php | 16 +- .../Operations/CreateCustomerResponseBody.php | 16 +- .../Operations/CreateDomainRequestBody.php | 20 +- .../Operations/CreateLinkRequestBody.php | 150 +++---- src/Models/Operations/Data.php | 142 +++---- .../Operations/GetCustomerResponseBody.php | 16 +- .../Operations/GetLinksCountRequest.php | 18 +- src/Models/Operations/ListDomainsRequest.php | 18 +- src/Models/Operations/ListEventsRequest.php | 54 +-- src/Models/Operations/RequestBody.php | 150 +++---- src/Models/Operations/ResponseBody.php | 16 +- .../Operations/RetrieveAnalyticsRequest.php | 54 +-- .../Operations/TrackLeadRequestBody.php | 22 +- .../Operations/TrackSaleRequestBody.php | 66 ++-- .../Operations/UpdateCustomerRequestBody.php | 18 +- .../Operations/UpdateCustomerResponseBody.php | 16 +- .../Operations/UpdateDomainRequestBody.php | 20 +- .../Operations/UpdateLinkRequestBody.php | 150 +++---- .../Operations/UpsertLinkRequestBody.php | 150 +++---- src/SDKConfiguration.php | 6 +- src/Tags.php | 82 ++-- src/Track.php | 58 +-- src/Utils/RequestBodies.php | 11 +- src/Utils/Utils.php | 105 +++++ 61 files changed, 2227 insertions(+), 1971 deletions(-) create mode 100644 src/Hooks/Credentials.php create mode 100644 src/Hooks/Session.php create mode 100644 src/Hooks/TokenResponse.php diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e0dc750..65249dc 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 43187d3e-7c3c-4c11-b5d4-4b2334fb6d96 management: - docChecksum: 696b11ac8aea0ac84de6ac987269993a + docChecksum: cb382cc4468d569fac201d1bf8058387 docVersion: 0.0.1 - speakeasyVersion: 1.453.10 - generationVersion: 2.474.15 - releaseVersion: 0.11.7 - configChecksum: ea2add875b69cf6a396427e2da8b3606 + speakeasyVersion: 1.456.0 + generationVersion: 2.481.0 + releaseVersion: 0.11.8 + configChecksum: a8cc33f7e922f0c9bd4c6053e0feb7e1 repoURL: https://github.com/dubinc/dub-php.git installationURL: https://github.com/dubinc/dub-php published: true features: php: constsAndDefaults: 0.2.0 - core: 3.7.4 + core: 3.7.7 deprecations: 2.81.1 errors: 0.3.0 examples: 2.81.3 @@ -279,6 +279,7 @@ generatedFiles: - src/Hooks/AfterSuccessHook.php - src/Hooks/BeforeRequestContext.php - src/Hooks/BeforeRequestHook.php + - src/Hooks/Credentials.php - src/Hooks/ErrorResponseContext.php - src/Hooks/FailEarlyException.php - src/Hooks/HookContext.php @@ -286,6 +287,8 @@ generatedFiles: - src/Hooks/SDKHooks.php - src/Hooks/SDKInitHook.php - src/Hooks/SDKRequestContext.php + - src/Hooks/Session.php + - src/Hooks/TokenResponse.php - src/Links.php - src/Metatags.php - src/Models/Components/AnalyticsBrowsers.php @@ -882,7 +885,7 @@ examples: idOrSlug: "" responses: "200": - application/json: {"id": "", "name": "", "slug": "", "logo": "", "inviteCode": "", "plan": "business extra", "stripeId": "", "billingCycleStart": "900.65", "paymentFailedAt": "", "stripeConnectId": "", "usage": "5588.34", "usageLimit": "8441.99", "linksUsage": "5442.21", "linksLimit": "8306.36", "salesUsage": "5212.35", "salesLimit": "785.92", "domainsLimit": "9699.61", "tagsLimit": "8661.61", "usersLimit": "4580.49", "aiUsage": "7352.87", "aiLimit": "4508.24", "conversionEnabled": true, "dotLinkClaimed": true, "createdAt": "", "users": [], "domains": [], "bankAccountName": "", "partialAccountNumber": "", "routingNumber": "", "bankAccountVerified": false} + application/json: {"id": "", "name": "", "slug": "", "logo": "", "inviteCode": "", "plan": "business extra", "stripeId": "", "billingCycleStart": "900.65", "paymentFailedAt": "", "stripeConnectId": "", "payoutMethodId": "", "usage": "5588.34", "usageLimit": "8441.99", "linksUsage": "5442.21", "linksLimit": "8306.36", "salesUsage": "5212.35", "salesLimit": "785.92", "domainsLimit": "9699.61", "tagsLimit": "8661.61", "usersLimit": "4580.49", "aiUsage": "7352.87", "aiLimit": "4508.24", "conversionEnabled": true, "dotLinkClaimed": true, "createdAt": "", "users": [], "domains": []} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#bad-request"}} "401": @@ -908,7 +911,7 @@ examples: idOrSlug: "" responses: "200": - application/json: {"id": "", "name": "", "slug": "", "logo": "", "inviteCode": "", "plan": "enterprise", "stripeId": "", "billingCycleStart": "245.55", "paymentFailedAt": "", "stripeConnectId": "", "usage": "5971.29", "usageLimit": "156.52", "linksUsage": "3446.2", "linksLimit": "7084.55", "salesUsage": "9914.64", "salesLimit": "2703.24", "domainsLimit": "6276.9", "tagsLimit": "6841.99", "usersLimit": "4888.52", "aiUsage": "4430.76", "aiLimit": "9840.08", "conversionEnabled": false, "dotLinkClaimed": false, "createdAt": "", "users": [], "domains": [], "bankAccountName": "", "partialAccountNumber": "", "routingNumber": "", "bankAccountVerified": false} + application/json: {"id": "", "name": "", "slug": "", "logo": "", "inviteCode": "", "plan": "enterprise", "stripeId": "", "billingCycleStart": "245.55", "paymentFailedAt": "", "stripeConnectId": "", "payoutMethodId": "", "usage": "5971.29", "usageLimit": "156.52", "linksUsage": "3446.2", "linksLimit": "7084.55", "salesUsage": "9914.64", "salesLimit": "2703.24", "domainsLimit": "6276.9", "tagsLimit": "6841.99", "usersLimit": "4888.52", "aiUsage": "4430.76", "aiLimit": "9840.08", "conversionEnabled": false, "dotLinkClaimed": false, "createdAt": "", "users": [], "domains": []} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#bad-request"}} "401": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a7afe2d..14e3b74 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,12 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false php: - version: 0.11.7 + version: 0.11.8 + additionalDependencies: + autoload: {} + autoload-dev: {} + require: {} + require-dev: {} clientServerStatusCodesAsErrors: true defaultErrorName: SDKException flattenGlobalSecurity: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index eb3b3f3..b20b1d6 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.453.10 +speakeasyVersion: 1.456.0 sources: dub: sourceNamespace: dub - sourceRevisionDigest: sha256:fe8aa1c3c33a5e99dc894af333b3e9fbadc83942dc75d10ee956b0539cea4bcd - sourceBlobDigest: sha256:4fb9afd3f82041cb034a365f95133390b69b22cbb6bd915dea4c7ce235cc144b + sourceRevisionDigest: sha256:44929bb9c3739d49f288e5dd88744fa47f3e1c2447bc58d1848faede36ab7ba7 + sourceBlobDigest: sha256:1a0d16219c5d15e56c8d4f3010b89035f7ea6d5af284d33241f231f8e87d361c tags: - latest - - speakeasy-sdk-regen-1733876473 + - speakeasy-sdk-regen-1734481213 - 0.0.1 targets: my-first-target: source: dub sourceNamespace: dub - sourceRevisionDigest: sha256:fe8aa1c3c33a5e99dc894af333b3e9fbadc83942dc75d10ee956b0539cea4bcd - sourceBlobDigest: sha256:4fb9afd3f82041cb034a365f95133390b69b22cbb6bd915dea4c7ce235cc144b + sourceRevisionDigest: sha256:44929bb9c3739d49f288e5dd88744fa47f3e1c2447bc58d1848faede36ab7ba7 + sourceBlobDigest: sha256:1a0d16219c5d15e56c8d4f3010b89035f7ea6d5af284d33241f231f8e87d361c codeSamplesNamespace: code-samples-php-my-first-target - codeSamplesRevisionDigest: sha256:303e2be57a76dbcc7ccf9e878e12ba010ac4fb0a330dfb679b65610c0263fce4 + codeSamplesRevisionDigest: sha256:8e4846aee9b085e388ecdc3e11e7e8b49aaab4d011039f39ade36c7173893a37 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index fde031b..93a1e33 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Dub.co API: Dub is link management infrastructure for companies to create market * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) * [Available Resources and Operations](#available-resources-and-operations) + * [Pagination](#pagination) * [Error Handling](#error-handling) * [Server Selection](#server-selection) * [Development](#development) @@ -117,18 +118,18 @@ if ($response->linkSchema !== null) { ### [customers](docs/sdks/customers/README.md) -* [list](docs/sdks/customers/README.md#list) - Retrieve a list of customers * [create](docs/sdks/customers/README.md#create) - Create a customer +* [delete](docs/sdks/customers/README.md#delete) - Delete a customer * [get](docs/sdks/customers/README.md#get) - Retrieve a customer +* [list](docs/sdks/customers/README.md#list) - Retrieve a list of customers * [update](docs/sdks/customers/README.md#update) - Update a customer -* [delete](docs/sdks/customers/README.md#delete) - Delete a customer ### [domains](docs/sdks/domains/README.md) * [create](docs/sdks/domains/README.md#create) - Create a domain +* [delete](docs/sdks/domains/README.md#delete) - Delete a domain * [list](docs/sdks/domains/README.md#list) - Retrieve a list of domains * [update](docs/sdks/domains/README.md#update) - Update a domain -* [delete](docs/sdks/domains/README.md#delete) - Delete a domain ### [embedTokens](docs/sdks/embedtokens/README.md) @@ -141,15 +142,15 @@ if ($response->linkSchema !== null) { ### [links](docs/sdks/links/README.md) +* [createMany](docs/sdks/links/README.md#createmany) - Bulk create links +* [deleteMany](docs/sdks/links/README.md#deletemany) - Bulk delete links +* [updateMany](docs/sdks/links/README.md#updatemany) - Bulk update links * [create](docs/sdks/links/README.md#create) - Create a new link +* [delete](docs/sdks/links/README.md#delete) - Delete a link +* [get](docs/sdks/links/README.md#get) - Retrieve a link * [list](docs/sdks/links/README.md#list) - Retrieve a list of links * [count](docs/sdks/links/README.md#count) - Retrieve links count -* [get](docs/sdks/links/README.md#get) - Retrieve a link * [update](docs/sdks/links/README.md#update) - Update a link -* [delete](docs/sdks/links/README.md#delete) - Delete a link -* [createMany](docs/sdks/links/README.md#createmany) - Bulk create links -* [updateMany](docs/sdks/links/README.md#updatemany) - Bulk update links -* [deleteMany](docs/sdks/links/README.md#deletemany) - Bulk delete links * [upsert](docs/sdks/links/README.md#upsert) - Upsert a link ### [metatags](docs/sdks/metatags/README.md) @@ -163,15 +164,15 @@ if ($response->linkSchema !== null) { ### [tags](docs/sdks/tags/README.md) * [create](docs/sdks/tags/README.md#create) - Create a new tag +* [delete](docs/sdks/tags/README.md#delete) - Delete a tag * [list](docs/sdks/tags/README.md#list) - Retrieve a list of tags * [update](docs/sdks/tags/README.md#update) - Update a tag -* [delete](docs/sdks/tags/README.md#delete) - Delete a tag ### [track](docs/sdks/track/README.md) +* [~~customer~~](docs/sdks/track/README.md#customer) - Track a customer :warning: **Deprecated** * [lead](docs/sdks/track/README.md#lead) - Track a lead * [sale](docs/sdks/track/README.md#sale) - Track a sale -* [~~customer~~](docs/sdks/track/README.md#customer) - Track a customer :warning: **Deprecated** ### [workspaces](docs/sdks/workspaces/README.md) @@ -181,6 +182,43 @@ if ($response->linkSchema !== null) { + +## Pagination + +Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the +returned object will be a `Generator` instead of an individual response. + +Working with generators is as simple as iterating over the responses in a `foreach` loop, and you can see an example below: +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Dub; +use Dub\Models\Operations; + +$security = 'DUB_API_KEY'; + +$sdk = Dub\Dub::builder()->setSecurity($security)->build(); + +$request = new Operations\GetLinksRequest( + page: 1, + pageSize: 50, +); + +$responses = $sdk->links->list( + request: $request +); + + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } +} +``` + + ## Error Handling @@ -195,7 +233,7 @@ By default an API error will raise a `Errors\SDKException` exception, which has | `$rawResponse` | *?\Psr\Http\Message\ResponseInterface* | The raw HTTP response | | `$body` | *string* | The response content | -When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create` method throws the following exceptions: +When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `createMany` method throws the following exceptions: | Error Type | Status Code | Content Type | | -------------------------- | ----------- | ---------------- | @@ -225,19 +263,21 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); try { - $request = new Operations\CreateLinkRequestBody( - url: 'https://google.com', - tagIds: [ - 'clux0rgak00011...', - ], - externalId: '123456', - ); - - $response = $sdk->links->create( + $request = [ + new Operations\RequestBody( + url: 'https://google.com', + tagIds: [ + 'clux0rgak00011...', + ], + externalId: '123456', + ), + ]; + + $response = $sdk->links->createMany( request: $request ); - if ($response->linkSchema !== null) { + if ($response->linkSchemas !== null) { // handle response } } catch (Errors\BadRequestThrowable $e) { @@ -294,19 +334,21 @@ $sdk = Dub\Dub::builder() ->setServerURL('https://api.dub.co') ->setSecurity($security)->build(); -$request = new Operations\CreateLinkRequestBody( - url: 'https://google.com', - tagIds: [ - 'clux0rgak00011...', - ], - externalId: '123456', -); +$request = [ + new Operations\RequestBody( + url: 'https://google.com', + tagIds: [ + 'clux0rgak00011...', + ], + externalId: '123456', + ), +]; -$response = $sdk->links->create( +$response = $sdk->links->createMany( request: $request ); -if ($response->linkSchema !== null) { +if ($response->linkSchemas !== null) { // handle response } ``` diff --git a/RELEASES.md b/RELEASES.md index d43e551..b364ab7 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -520,4 +520,14 @@ Based on: ### Generated - [php v0.11.7] . ### Releases -- [Composer v0.11.7] https://packagist.org/packages/dub/dub-php#v0.11.7 - . \ No newline at end of file +- [Composer v0.11.7] https://packagist.org/packages/dub/dub-php#v0.11.7 - . + +## 2024-12-18 00:20:10 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.456.0 (2.481.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v0.11.8] . +### Releases +- [Composer v0.11.8] https://packagist.org/packages/dub/dub-php#v0.11.8 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 41e9bcc..e9430ec 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -44,7 +44,7 @@ actions: "x-codeSamples": - "lang": "php" "label": "listDomains" - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n\n\n$response = $sdk->domains->list(\n archived: true,\n search: '',\n page: 1,\n pageSize: 50\n\n);\n\nif ($response->domainSchemas !== null) {\n // handle response\n}" + "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n\n\n$responses = $sdk->domains->list(\n archived: true,\n search: '',\n page: 1,\n pageSize: 50\n\n);\n\n\nforeach ($responses as $response) {\n if ($response->statusCode === 200) {\n // handle response\n }\n}" - target: $["paths"]["/domains"]["post"] update: "x-codeSamples": @@ -74,7 +74,7 @@ actions: "x-codeSamples": - "lang": "php" "label": "getLinks" - "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$request = new Operations\\GetLinksRequest(\n page: 1,\n pageSize: 50,\n);\n\n$response = $sdk->links->list(\n request: $request\n);\n\nif ($response->linkSchemas !== null) {\n // handle response\n}" + "source": "declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$security = 'DUB_API_KEY';\n\n$sdk = Dub\\Dub::builder()->setSecurity($security)->build();\n\n$request = new Operations\\GetLinksRequest(\n page: 1,\n pageSize: 50,\n);\n\n$responses = $sdk->links->list(\n request: $request\n);\n\n\nforeach ($responses as $response) {\n if ($response->statusCode === 200) {\n // handle response\n }\n}" - target: $["paths"]["/links"]["post"] update: "x-codeSamples": diff --git a/docs/Models/Components/WorkspaceSchema.md b/docs/Models/Components/WorkspaceSchema.md index dec9a5b..5e93be9 100644 --- a/docs/Models/Components/WorkspaceSchema.md +++ b/docs/Models/Components/WorkspaceSchema.md @@ -26,13 +26,10 @@ | `createdAt` | *string* | :heavy_check_mark: | The date and time when the workspace was created. | | `users` | array<[Components\Users](../../Models/Components/Users.md)> | :heavy_check_mark: | The role of the authenticated user in the workspace. | | `domains` | array<[Components\Domains](../../Models/Components/Domains.md)> | :heavy_check_mark: | The domains of the workspace. | -| `bankAccountVerified` | *bool* | :heavy_check_mark: | [BETA – Dub Partners]: Whether the bank account is verified. | | `inviteCode` | *string* | :heavy_check_mark: | The invite code of the workspace. | | `stripeId` | *string* | :heavy_check_mark: | The Stripe ID of the workspace. | | `paymentFailedAt` | *string* | :heavy_check_mark: | The date and time when the payment failed for the workspace. | | `stripeConnectId` | *string* | :heavy_check_mark: | [BETA – Dub Conversions]: The Stripe Connect ID of the workspace. | +| `payoutMethodId` | *string* | :heavy_check_mark: | [BETA – Dub Partners]: The ID of the payment method for partner payouts. | | `flags` | array | :heavy_minus_sign: | The feature flags of the workspace, indicating which features are enabled. | -| `bankAccountName` | *string* | :heavy_check_mark: | [BETA – Dub Partners]: The name of the connected bank account. | -| `partialAccountNumber` | *string* | :heavy_check_mark: | [BETA – Dub Partners]: The partial account number of the bank account. | -| `routingNumber` | *string* | :heavy_check_mark: | [BETA – Dub Partners]: The routing number of the bank account. | | `logo` | *?string* | :heavy_minus_sign: | The logo of the workspace. | \ No newline at end of file diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index b95c30d..36908fe 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -5,15 +5,15 @@ ### Available Operations -* [list](#list) - Retrieve a list of customers * [create](#create) - Create a customer +* [delete](#delete) - Delete a customer * [get](#get) - Retrieve a customer +* [list](#list) - Retrieve a list of customers * [update](#update) - Update a customer -* [delete](#delete) - Delete a customer -## list +## create -Retrieve a list of customers for the authenticated workspace. +Create a customer for the authenticated workspace. ### Example Usage @@ -23,25 +23,34 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; +use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); +$request = new Operations\CreateCustomerRequestBody( + externalId: '', +); - -$response = $sdk->customers->list( - +$response = $sdk->customers->create( + request: $request ); -if ($response->responseBodies !== null) { +if ($response->object !== null) { // handle response } ``` +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `$request` | [Operations\CreateCustomerRequestBody](../../Models/Operations/CreateCustomerRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + ### Response -**[?Operations\GetCustomersResponse](../../Models/Operations/GetCustomersResponse.md)** +**[?Operations\CreateCustomerResponse](../../Models/Operations/CreateCustomerResponse.md)** ### Errors @@ -58,9 +67,9 @@ if ($response->responseBodies !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## create +## delete -Create a customer for the authenticated workspace. +Delete a customer from a workspace. ### Example Usage @@ -70,18 +79,15 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; -use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\CreateCustomerRequestBody( - externalId: '', -); -$response = $sdk->customers->create( - request: $request + +$response = $sdk->customers->delete( + id: '' ); if ($response->object !== null) { @@ -91,13 +97,13 @@ if ($response->object !== null) { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `$request` | [Operations\CreateCustomerRequestBody](../../Models/Operations/CreateCustomerRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the customer in Dub. | ### Response -**[?Operations\CreateCustomerResponse](../../Models/Operations/CreateCustomerResponse.md)** +**[?Operations\DeleteCustomerResponse](../../Models/Operations/DeleteCustomerResponse.md)** ### Errors @@ -167,9 +173,9 @@ if ($response->object !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## update +## list -Update a customer for the authenticated workspace. +Retrieve a list of customers for the authenticated workspace. ### Example Usage @@ -179,35 +185,25 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; -use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$requestBody = new Operations\UpdateCustomerRequestBody(); -$response = $sdk->customers->update( - id: '', - requestBody: $requestBody + +$response = $sdk->customers->list( ); -if ($response->object !== null) { +if ($response->responseBodies !== null) { // handle response } ``` -### Parameters - -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The unique identifier of the customer in Dub. | -| `requestBody` | [?Operations\UpdateCustomerRequestBody](../../Models/Operations/UpdateCustomerRequestBody.md) | :heavy_minus_sign: | N/A | - ### Response -**[?Operations\UpdateCustomerResponse](../../Models/Operations/UpdateCustomerResponse.md)** +**[?Operations\GetCustomersResponse](../../Models/Operations/GetCustomersResponse.md)** ### Errors @@ -224,9 +220,9 @@ if ($response->object !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## delete +## update -Delete a customer from a workspace. +Update a customer for the authenticated workspace. ### Example Usage @@ -236,15 +232,18 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; +use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); +$requestBody = new Operations\UpdateCustomerRequestBody(); +$response = $sdk->customers->update( + id: '', + requestBody: $requestBody -$response = $sdk->customers->delete( - id: '' ); if ($response->object !== null) { @@ -254,13 +253,14 @@ if ($response->object !== null) { ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The unique identifier of the customer in Dub. | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the customer in Dub. | +| `requestBody` | [?Operations\UpdateCustomerRequestBody](../../Models/Operations/UpdateCustomerRequestBody.md) | :heavy_minus_sign: | N/A | ### Response -**[?Operations\DeleteCustomerResponse](../../Models/Operations/DeleteCustomerResponse.md)** +**[?Operations\UpdateCustomerResponse](../../Models/Operations/UpdateCustomerResponse.md)** ### Errors diff --git a/docs/sdks/domains/README.md b/docs/sdks/domains/README.md index 40fce86..1616b8f 100644 --- a/docs/sdks/domains/README.md +++ b/docs/sdks/domains/README.md @@ -6,9 +6,9 @@ ### Available Operations * [create](#create) - Create a domain +* [delete](#delete) - Delete a domain * [list](#list) - Retrieve a list of domains * [update](#update) - Update a domain -* [delete](#delete) - Delete a domain ## create @@ -70,9 +70,9 @@ if ($response->domainSchema !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## list +## delete -Retrieve a list of domains associated with the authenticated workspace. +Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain. ### Example Usage @@ -89,31 +89,24 @@ $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$response = $sdk->domains->list( - archived: true, - search: '', - page: 1, - pageSize: 50 - +$response = $sdk->domains->delete( + slug: 'acme.com' ); -if ($response->domainSchemas !== null) { +if ($response->object !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `archived` | *?bool* | :heavy_minus_sign: | Whether to include archived domains in the response. Defaults to `false` if not provided. | | -| `search` | *?string* | :heavy_minus_sign: | The search term to filter the domains by. | | -| `page` | *?float* | :heavy_minus_sign: | The page number for pagination. | 1 | -| `pageSize` | *?float* | :heavy_minus_sign: | The number of items per page. | 50 | +| Parameter | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `slug` | *string* | :heavy_check_mark: | The domain name. | acme.com | ### Response -**[?Operations\ListDomainsResponse](../../Models/Operations/ListDomainsResponse.md)** +**[?Operations\DeleteDomainResponse](../../Models/Operations/DeleteDomainResponse.md)** ### Errors @@ -130,9 +123,9 @@ if ($response->domainSchemas !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## update +## list -Update a domain for the authenticated workspace. +Retrieve a list of domains associated with the authenticated workspace. ### Example Usage @@ -142,28 +135,26 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; -use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$requestBody = new Operations\UpdateDomainRequestBody( - slug: 'acme.com', - archived: false, - expiredUrl: 'https://acme.com/expired', - notFoundUrl: 'https://acme.com/not-found', - placeholder: 'https://dub.co/help/article/what-is-dub', -); -$response = $sdk->domains->update( - slug: 'acme.com', - requestBody: $requestBody + +$responses = $sdk->domains->list( + archived: true, + search: '', + page: 1, + pageSize: 50 ); -if ($response->domainSchema !== null) { - // handle response + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } } ``` @@ -171,12 +162,14 @@ if ($response->domainSchema !== null) { | Parameter | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `slug` | *string* | :heavy_check_mark: | The domain name. | acme.com | -| `requestBody` | [?Operations\UpdateDomainRequestBody](../../Models/Operations/UpdateDomainRequestBody.md) | :heavy_minus_sign: | N/A | | +| `archived` | *?bool* | :heavy_minus_sign: | Whether to include archived domains in the response. Defaults to `false` if not provided. | | +| `search` | *?string* | :heavy_minus_sign: | The search term to filter the domains by. | | +| `page` | *?float* | :heavy_minus_sign: | The page number for pagination. | 1 | +| `pageSize` | *?float* | :heavy_minus_sign: | The number of items per page. | 50 | ### Response -**[?Operations\UpdateDomainResponse](../../Models/Operations/UpdateDomainResponse.md)** +**[?Operations\ListDomainsResponse](../../Models/Operations/ListDomainsResponse.md)** ### Errors @@ -193,9 +186,9 @@ if ($response->domainSchema !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## delete +## update -Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain. +Update a domain for the authenticated workspace. ### Example Usage @@ -205,31 +198,41 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; +use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); +$requestBody = new Operations\UpdateDomainRequestBody( + slug: 'acme.com', + archived: false, + expiredUrl: 'https://acme.com/expired', + notFoundUrl: 'https://acme.com/not-found', + placeholder: 'https://dub.co/help/article/what-is-dub', +); +$response = $sdk->domains->update( + slug: 'acme.com', + requestBody: $requestBody -$response = $sdk->domains->delete( - slug: 'acme.com' ); -if ($response->object !== null) { +if ($response->domainSchema !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `slug` | *string* | :heavy_check_mark: | The domain name. | acme.com | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `slug` | *string* | :heavy_check_mark: | The domain name. | acme.com | +| `requestBody` | [?Operations\UpdateDomainRequestBody](../../Models/Operations/UpdateDomainRequestBody.md) | :heavy_minus_sign: | N/A | | ### Response -**[?Operations\DeleteDomainResponse](../../Models/Operations/DeleteDomainResponse.md)** +**[?Operations\UpdateDomainResponse](../../Models/Operations/UpdateDomainResponse.md)** ### Errors diff --git a/docs/sdks/links/README.md b/docs/sdks/links/README.md index cf48733..a8c65f4 100644 --- a/docs/sdks/links/README.md +++ b/docs/sdks/links/README.md @@ -5,20 +5,20 @@ ### Available Operations +* [createMany](#createmany) - Bulk create links +* [deleteMany](#deletemany) - Bulk delete links +* [updateMany](#updatemany) - Bulk update links * [create](#create) - Create a new link +* [delete](#delete) - Delete a link +* [get](#get) - Retrieve a link * [list](#list) - Retrieve a list of links * [count](#count) - Retrieve links count -* [get](#get) - Retrieve a link * [update](#update) - Update a link -* [delete](#delete) - Delete a link -* [createMany](#createmany) - Bulk create links -* [updateMany](#updatemany) - Bulk update links -* [deleteMany](#deletemany) - Bulk delete links * [upsert](#upsert) - Upsert a link -## create +## createMany -Create a new link for the authenticated workspace. +Bulk create up to 100 links for the authenticated workspace. ### Example Usage @@ -34,32 +34,34 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\CreateLinkRequestBody( - url: 'https://google.com', - tagIds: [ - 'clux0rgak00011...', - ], - externalId: '123456', -); +$request = [ + new Operations\RequestBody( + url: 'https://google.com', + tagIds: [ + 'clux0rgak00011...', + ], + externalId: '123456', + ), +]; -$response = $sdk->links->create( +$response = $sdk->links->createMany( request: $request ); -if ($response->linkSchema !== null) { +if ($response->linkSchemas !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `$request` | [Operations\CreateLinkRequestBody](../../Models/Operations/CreateLinkRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `$request` | [array](../../.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\CreateLinkResponse](../../Models/Operations/CreateLinkResponse.md)** +**[?Operations\BulkCreateLinksResponse](../../Models/Operations/BulkCreateLinksResponse.md)** ### Errors @@ -76,9 +78,9 @@ if ($response->linkSchema !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## list +## deleteMany -Retrieve a paginated list of links for the authenticated workspace. +Bulk delete up to 100 links for the authenticated workspace. ### Example Usage @@ -88,35 +90,34 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; -use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\GetLinksRequest( - page: 1, - pageSize: 50, -); -$response = $sdk->links->list( - request: $request + +$response = $sdk->links->deleteMany( + linkIds: [ + 'clux0rgak00011...', + 'clux0rgak00022...', + ] ); -if ($response->linkSchemas !== null) { +if ($response->object !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `$request` | [Operations\GetLinksRequest](../../Models/Operations/GetLinksRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `linkIds` | array<*string*> | :heavy_check_mark: | Comma-separated list of link IDs to delete. Maximum of 100 IDs. Non-existing IDs will be ignored. | [
"clux0rgak00011...",
"clux0rgak00022..."
] | ### Response -**[?Operations\GetLinksResponse](../../Models/Operations/GetLinksResponse.md)** +**[?Operations\BulkDeleteLinksResponse](../../Models/Operations/BulkDeleteLinksResponse.md)** ### Errors @@ -133,9 +134,9 @@ if ($response->linkSchemas !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## count +## updateMany -Retrieve the number of links for the authenticated workspace. +Bulk update up to 100 links with the same data for the authenticated workspace. ### Example Usage @@ -151,26 +152,33 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\GetLinksCountRequest(); +$request = new Operations\BulkUpdateLinksRequestBody( + data: new Operations\Data( + url: 'https://google.com', + tagIds: [ + 'clux0rgak00011...', + ], + ), +); -$response = $sdk->links->count( +$response = $sdk->links->updateMany( request: $request ); -if ($response->number !== null) { +if ($response->linkSchemas !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `$request` | [Operations\GetLinksCountRequest](../../Models/Operations/GetLinksCountRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `$request` | [Operations\BulkUpdateLinksRequestBody](../../Models/Operations/BulkUpdateLinksRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\GetLinksCountResponse](../../Models/Operations/GetLinksCountResponse.md)** +**[?Operations\BulkUpdateLinksResponse](../../Models/Operations/BulkUpdateLinksResponse.md)** ### Errors @@ -187,9 +195,9 @@ if ($response->number !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## get +## create -Retrieve the info for a link. +Create a new link for the authenticated workspace. ### Example Usage @@ -199,19 +207,22 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; +use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); +$request = new Operations\CreateLinkRequestBody( + url: 'https://google.com', + tagIds: [ + 'clux0rgak00011...', + ], + externalId: '123456', +); - -$response = $sdk->links->get( - domain: 'rural-mathematics.name', - key: '', - linkId: 'clux0rgak00011...', - externalId: '123456' - +$response = $sdk->links->create( + request: $request ); if ($response->linkSchema !== null) { @@ -221,16 +232,13 @@ if ($response->linkSchema !== null) { ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `domain` | *?string* | :heavy_minus_sign: | N/A | | -| `key` | *?string* | :heavy_minus_sign: | The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`. | | -| `linkId` | *?string* | :heavy_minus_sign: | The unique ID of the short link. | clux0rgak00011... | -| `externalId` | *?string* | :heavy_minus_sign: | This is the ID of the link in the your database. | 123456 | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `$request` | [Operations\CreateLinkRequestBody](../../Models/Operations/CreateLinkRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\GetLinkInfoResponse](../../Models/Operations/GetLinkInfoResponse.md)** +**[?Operations\CreateLinkResponse](../../Models/Operations/CreateLinkResponse.md)** ### Errors @@ -247,9 +255,9 @@ if ($response->linkSchema !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## update +## delete -Update a link for the authenticated workspace. If there's no change, returns it as it is. +Delete a link for the authenticated workspace. ### Example Usage @@ -259,27 +267,18 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; -use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$requestBody = new Operations\UpdateLinkRequestBody( - url: 'https://google.com', - tagIds: [ - 'clux0rgak00011...', - ], - externalId: '123456', -); -$response = $sdk->links->update( - linkId: '', - requestBody: $requestBody +$response = $sdk->links->delete( + linkId: '' ); -if ($response->linkSchema !== null) { +if ($response->object !== null) { // handle response } ``` @@ -288,12 +287,11 @@ if ($response->linkSchema !== null) { | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `linkId` | *string* | :heavy_check_mark: | The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. | -| `requestBody` | [?Operations\UpdateLinkRequestBody](../../Models/Operations/UpdateLinkRequestBody.md) | :heavy_minus_sign: | N/A | +| `linkId` | *string* | :heavy_check_mark: | The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. | ### Response -**[?Operations\UpdateLinkResponse](../../Models/Operations/UpdateLinkResponse.md)** +**[?Operations\DeleteLinkResponse](../../Models/Operations/DeleteLinkResponse.md)** ### Errors @@ -310,9 +308,9 @@ if ($response->linkSchema !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## delete +## get -Delete a link for the authenticated workspace. +Retrieve the info for a link. ### Example Usage @@ -329,24 +327,31 @@ $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$response = $sdk->links->delete( - linkId: '' +$response = $sdk->links->get( + domain: 'rural-mathematics.name', + key: '', + linkId: 'clux0rgak00011...', + externalId: '123456' + ); -if ($response->object !== null) { +if ($response->linkSchema !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `linkId` | *string* | :heavy_check_mark: | The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `domain` | *?string* | :heavy_minus_sign: | N/A | | +| `key` | *?string* | :heavy_minus_sign: | The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`. | | +| `linkId` | *?string* | :heavy_minus_sign: | The unique ID of the short link. | clux0rgak00011... | +| `externalId` | *?string* | :heavy_minus_sign: | This is the ID of the link in the your database. | 123456 | ### Response -**[?Operations\DeleteLinkResponse](../../Models/Operations/DeleteLinkResponse.md)** +**[?Operations\GetLinkInfoResponse](../../Models/Operations/GetLinkInfoResponse.md)** ### Errors @@ -363,9 +368,9 @@ if ($response->object !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## createMany +## list -Bulk create up to 100 links for the authenticated workspace. +Retrieve a paginated list of links for the authenticated workspace. ### Example Usage @@ -381,34 +386,32 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = [ - new Operations\RequestBody( - url: 'https://google.com', - tagIds: [ - 'clux0rgak00011...', - ], - externalId: '123456', - ), -]; +$request = new Operations\GetLinksRequest( + page: 1, + pageSize: 50, +); -$response = $sdk->links->createMany( +$responses = $sdk->links->list( request: $request ); -if ($response->linkSchemas !== null) { - // handle response + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } } ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `$request` | [array](../../.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `$request` | [Operations\GetLinksRequest](../../Models/Operations/GetLinksRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\BulkCreateLinksResponse](../../Models/Operations/BulkCreateLinksResponse.md)** +**[?Operations\GetLinksResponse](../../Models/Operations/GetLinksResponse.md)** ### Errors @@ -425,9 +428,9 @@ if ($response->linkSchemas !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## updateMany +## count -Bulk update up to 100 links with the same data for the authenticated workspace. +Retrieve the number of links for the authenticated workspace. ### Example Usage @@ -443,33 +446,26 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\BulkUpdateLinksRequestBody( - data: new Operations\Data( - url: 'https://google.com', - tagIds: [ - 'clux0rgak00011...', - ], - ), -); +$request = new Operations\GetLinksCountRequest(); -$response = $sdk->links->updateMany( +$response = $sdk->links->count( request: $request ); -if ($response->linkSchemas !== null) { +if ($response->number !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `$request` | [Operations\BulkUpdateLinksRequestBody](../../Models/Operations/BulkUpdateLinksRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `$request` | [Operations\GetLinksCountRequest](../../Models/Operations/GetLinksCountRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\BulkUpdateLinksResponse](../../Models/Operations/BulkUpdateLinksResponse.md)** +**[?Operations\GetLinksCountResponse](../../Models/Operations/GetLinksCountResponse.md)** ### Errors @@ -486,9 +482,9 @@ if ($response->linkSchemas !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## deleteMany +## update -Bulk delete up to 100 links for the authenticated workspace. +Update a link for the authenticated workspace. If there's no change, returns it as it is. ### Example Usage @@ -498,34 +494,41 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; +use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); +$requestBody = new Operations\UpdateLinkRequestBody( + url: 'https://google.com', + tagIds: [ + 'clux0rgak00011...', + ], + externalId: '123456', +); +$response = $sdk->links->update( + linkId: '', + requestBody: $requestBody -$response = $sdk->links->deleteMany( - linkIds: [ - 'clux0rgak00011...', - 'clux0rgak00022...', - ] ); -if ($response->object !== null) { +if ($response->linkSchema !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `linkIds` | array<*string*> | :heavy_check_mark: | Comma-separated list of link IDs to delete. Maximum of 100 IDs. Non-existing IDs will be ignored. | [
"clux0rgak00011...",
"clux0rgak00022..."
] | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `linkId` | *string* | :heavy_check_mark: | The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. | +| `requestBody` | [?Operations\UpdateLinkRequestBody](../../Models/Operations/UpdateLinkRequestBody.md) | :heavy_minus_sign: | N/A | ### Response -**[?Operations\BulkDeleteLinksResponse](../../Models/Operations/BulkDeleteLinksResponse.md)** +**[?Operations\UpdateLinkResponse](../../Models/Operations/UpdateLinkResponse.md)** ### Errors diff --git a/docs/sdks/tags/README.md b/docs/sdks/tags/README.md index 8f955ff..42b7d36 100644 --- a/docs/sdks/tags/README.md +++ b/docs/sdks/tags/README.md @@ -6,9 +6,9 @@ ### Available Operations * [create](#create) - Create a new tag +* [delete](#delete) - Delete a tag * [list](#list) - Retrieve a list of tags * [update](#update) - Update a tag -* [delete](#delete) - Delete a tag ## create @@ -64,9 +64,9 @@ if ($response->tagSchema !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## list +## delete -Retrieve a list of tags for the authenticated workspace. +Delete a tag from the workspace. All existing links will still work, but they will no longer be associated with this tag. ### Example Usage @@ -83,18 +83,24 @@ $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$response = $sdk->tags->list( - +$response = $sdk->tags->delete( + id: '' ); -if ($response->tagSchemas !== null) { +if ($response->object !== null) { // handle response } ``` +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the tag to delete. | + ### Response -**[?Operations\GetTagsResponse](../../Models/Operations/GetTagsResponse.md)** +**[?Operations\DeleteTagResponse](../../Models/Operations/DeleteTagResponse.md)** ### Errors @@ -111,9 +117,9 @@ if ($response->tagSchemas !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## update +## list -Update a tag in the workspace. +Retrieve a list of tags for the authenticated workspace. ### Example Usage @@ -123,35 +129,25 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; -use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$requestBody = new Operations\UpdateTagRequestBody(); -$response = $sdk->tags->update( - id: '', - requestBody: $requestBody + +$response = $sdk->tags->list( ); -if ($response->tagSchema !== null) { +if ($response->tagSchemas !== null) { // handle response } ``` -### Parameters - -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the tag to update. | -| `requestBody` | [?Operations\UpdateTagRequestBody](../../Models/Operations/UpdateTagRequestBody.md) | :heavy_minus_sign: | N/A | - ### Response -**[?Operations\UpdateTagResponse](../../Models/Operations/UpdateTagResponse.md)** +**[?Operations\GetTagsResponse](../../Models/Operations/GetTagsResponse.md)** ### Errors @@ -168,9 +164,9 @@ if ($response->tagSchema !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## delete +## update -Delete a tag from the workspace. All existing links will still work, but they will no longer be associated with this tag. +Update a tag in the workspace. ### Example Usage @@ -180,31 +176,35 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Dub; +use Dub\Models\Operations; $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); +$requestBody = new Operations\UpdateTagRequestBody(); +$response = $sdk->tags->update( + id: '', + requestBody: $requestBody -$response = $sdk->tags->delete( - id: '' ); -if ($response->object !== null) { +if ($response->tagSchema !== null) { // handle response } ``` ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | -| `id` | *string* | :heavy_check_mark: | The ID of the tag to delete. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the tag to update. | +| `requestBody` | [?Operations\UpdateTagRequestBody](../../Models/Operations/UpdateTagRequestBody.md) | :heavy_minus_sign: | N/A | ### Response -**[?Operations\DeleteTagResponse](../../Models/Operations/DeleteTagResponse.md)** +**[?Operations\UpdateTagResponse](../../Models/Operations/UpdateTagResponse.md)** ### Errors diff --git a/docs/sdks/track/README.md b/docs/sdks/track/README.md index 691cfe1..de885e2 100644 --- a/docs/sdks/track/README.md +++ b/docs/sdks/track/README.md @@ -5,13 +5,15 @@ ### Available Operations +* [~~customer~~](#customer) - Track a customer :warning: **Deprecated** * [lead](#lead) - Track a lead * [sale](#sale) - Track a sale -* [~~customer~~](#customer) - Track a customer :warning: **Deprecated** -## lead +## ~~customer~~ -Track a lead for a short link. +Track a customer for an authenticated workspace. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage @@ -27,12 +29,11 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\TrackLeadRequestBody( - clickId: '', - eventName: 'Sign up', +$request = new Operations\TrackCustomerRequestBody( + customerId: '', ); -$response = $sdk->track->lead( +$response = $sdk->track->customer( request: $request ); @@ -43,13 +44,13 @@ if ($response->object !== null) { ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `$request` | [Operations\TrackLeadRequestBody](../../Models/Operations/TrackLeadRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `$request` | [Operations\TrackCustomerRequestBody](../../Models/Operations/TrackCustomerRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\TrackLeadResponse](../../Models/Operations/TrackLeadResponse.md)** +**[?Operations\TrackCustomerResponse](../../Models/Operations/TrackCustomerResponse.md)** ### Errors @@ -66,9 +67,9 @@ if ($response->object !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## sale +## lead -Track a sale for a short link. +Track a lead for a short link. ### Example Usage @@ -84,13 +85,12 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\TrackSaleRequestBody( - amount: 996500, - paymentProcessor: Operations\PaymentProcessor::Paddle, - eventName: 'Purchase', +$request = new Operations\TrackLeadRequestBody( + clickId: '', + eventName: 'Sign up', ); -$response = $sdk->track->sale( +$response = $sdk->track->lead( request: $request ); @@ -103,11 +103,11 @@ if ($response->object !== null) { | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `$request` | [Operations\TrackSaleRequestBody](../../Models/Operations/TrackSaleRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | +| `$request` | [Operations\TrackLeadRequestBody](../../Models/Operations/TrackLeadRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\TrackSaleResponse](../../Models/Operations/TrackSaleResponse.md)** +**[?Operations\TrackLeadResponse](../../Models/Operations/TrackLeadResponse.md)** ### Errors @@ -124,11 +124,9 @@ if ($response->object !== null) { | Errors\InternalServerError | 500 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## ~~customer~~ - -Track a customer for an authenticated workspace. +## sale -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. +Track a sale for a short link. ### Example Usage @@ -144,11 +142,13 @@ $security = 'DUB_API_KEY'; $sdk = Dub\Dub::builder()->setSecurity($security)->build(); -$request = new Operations\TrackCustomerRequestBody( - customerId: '', +$request = new Operations\TrackSaleRequestBody( + amount: 996500, + paymentProcessor: Operations\PaymentProcessor::Paddle, + eventName: 'Purchase', ); -$response = $sdk->track->customer( +$response = $sdk->track->sale( request: $request ); @@ -159,13 +159,13 @@ if ($response->object !== null) { ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `$request` | [Operations\TrackCustomerRequestBody](../../Models/Operations/TrackCustomerRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `$request` | [Operations\TrackSaleRequestBody](../../Models/Operations/TrackSaleRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[?Operations\TrackCustomerResponse](../../Models/Operations/TrackCustomerResponse.md)** +**[?Operations\TrackSaleResponse](../../Models/Operations/TrackSaleResponse.md)** ### Errors diff --git a/src/Customers.php b/src/Customers.php index 4d55040..3216ed3 100644 --- a/src/Customers.php +++ b/src/Customers.php @@ -44,23 +44,28 @@ public function getUrl(string $baseUrl, array $urlVariables): string } /** - * Retrieve a list of customers + * Create a customer * - * Retrieve a list of customers for the authenticated workspace. + * Create a customer for the authenticated workspace. * - * @return Operations\GetCustomersResponse + * @param ?Operations\CreateCustomerRequestBody $request + * @return Operations\CreateCustomerResponse * @throws \Dub\Models\Errors\SDKException */ - public function list(): Operations\GetCustomersResponse + public function create(?Operations\CreateCustomerRequestBody $request = null): Operations\CreateCustomerResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/customers'); $urlOverride = null; $options = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); - $hookContext = new HookContext('getCustomers', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('createCustomer', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -81,18 +86,18 @@ public function list(): Operations\GetCustomersResponse $httpResponse = $res; } } - if ($statusCode == 200) { + if ($statusCode == 201) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Operations\ResponseBody>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\GetCustomersResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\CreateCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\CreateCustomerResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - responseBodies: $obj); + object: $obj); return $response; } else { @@ -205,28 +210,27 @@ public function list(): Operations\GetCustomersResponse } /** - * Create a customer + * Delete a customer * - * Create a customer for the authenticated workspace. + * Delete a customer from a workspace. * - * @param ?Operations\CreateCustomerRequestBody $request - * @return Operations\CreateCustomerResponse + * @param string $id + * @return Operations\DeleteCustomerResponse * @throws \Dub\Models\Errors\SDKException */ - public function create(?Operations\CreateCustomerRequestBody $request = null): Operations\CreateCustomerResponse + public function delete(string $id): Operations\DeleteCustomerResponse { + $request = new Operations\DeleteCustomerRequest( + id: $id, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/customers'); + $url = Utils\Utils::generateUrl($baseUrl, '/customers/{id}', Operations\DeleteCustomerRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); - if ($body !== null) { - $options = array_merge_recursive($options, $body); - } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); - $hookContext = new HookContext('createCustomer', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('deleteCustomer', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -247,14 +251,14 @@ public function create(?Operations\CreateCustomerRequestBody $request = null): O $httpResponse = $res; } } - if ($statusCode == 201) { + if ($statusCode == 200) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\CreateCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\CreateCustomerResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\DeleteCustomerResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, @@ -536,33 +540,23 @@ public function get(string $id): Operations\GetCustomerResponse } /** - * Update a customer + * Retrieve a list of customers * - * Update a customer for the authenticated workspace. + * Retrieve a list of customers for the authenticated workspace. * - * @param string $id - * @param ?Operations\UpdateCustomerRequestBody $requestBody - * @return Operations\UpdateCustomerResponse + * @return Operations\GetCustomersResponse * @throws \Dub\Models\Errors\SDKException */ - public function update(string $id, ?Operations\UpdateCustomerRequestBody $requestBody = null): Operations\UpdateCustomerResponse + public function list(): Operations\GetCustomersResponse { - $request = new Operations\UpdateCustomerRequest( - id: $id, - requestBody: $requestBody, - ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/customers/{id}', Operations\UpdateCustomerRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/customers'); $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); - if ($body !== null) { - $options = array_merge_recursive($options, $body); - } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); - $hookContext = new HookContext('updateCustomer', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('getCustomers', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -589,12 +583,12 @@ public function update(string $id, ?Operations\UpdateCustomerRequestBody $reques $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\UpdateCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\UpdateCustomerResponse( + $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Operations\ResponseBody>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\GetCustomersResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - object: $obj); + responseBodies: $obj); return $response; } else { @@ -707,27 +701,33 @@ public function update(string $id, ?Operations\UpdateCustomerRequestBody $reques } /** - * Delete a customer + * Update a customer * - * Delete a customer from a workspace. + * Update a customer for the authenticated workspace. * * @param string $id - * @return Operations\DeleteCustomerResponse + * @param ?Operations\UpdateCustomerRequestBody $requestBody + * @return Operations\UpdateCustomerResponse * @throws \Dub\Models\Errors\SDKException */ - public function delete(string $id): Operations\DeleteCustomerResponse + public function update(string $id, ?Operations\UpdateCustomerRequestBody $requestBody = null): Operations\UpdateCustomerResponse { - $request = new Operations\DeleteCustomerRequest( + $request = new Operations\UpdateCustomerRequest( id: $id, + requestBody: $requestBody, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/customers/{id}', Operations\DeleteCustomerRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/customers/{id}', Operations\UpdateCustomerRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); - $hookContext = new HookContext('deleteCustomer', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext('updateCustomer', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -754,8 +754,8 @@ public function delete(string $id): Operations\DeleteCustomerResponse $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\DeleteCustomerResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\UpdateCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\UpdateCustomerResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, diff --git a/src/Domains.php b/src/Domains.php index 877149a..2d293b9 100644 --- a/src/Domains.php +++ b/src/Domains.php @@ -210,37 +210,28 @@ public function create(?Operations\CreateDomainRequestBody $request = null): Ope } /** - * Retrieve a list of domains + * Delete a domain * - * Retrieve a list of domains associated with the authenticated workspace. + * Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain. * - * @param ?bool $archived - * @param ?string $search - * @param ?float $page - * @param ?float $pageSize - * @return Operations\ListDomainsResponse + * @param string $slug + * @return Operations\DeleteDomainResponse * @throws \Dub\Models\Errors\SDKException */ - private function listIndividual(?bool $archived = null, ?string $search = null, ?float $page = null, ?float $pageSize = null): Operations\ListDomainsResponse + public function delete(string $slug): Operations\DeleteDomainResponse { - $request = new Operations\ListDomainsRequest( - archived: $archived, - search: $search, - page: $page, - pageSize: $pageSize, + $request = new Operations\DeleteDomainRequest( + slug: $slug, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/domains'); + $url = Utils\Utils::generateUrl($baseUrl, '/domains/{slug}', Operations\DeleteDomainRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; - - $qp = Utils\Utils::getQueryParams(Operations\ListDomainsRequest::class, $request, $urlOverride); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); - $hookContext = new HookContext('listDomains', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('deleteDomain', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -266,40 +257,12 @@ private function listIndividual(?bool $archived = null, ?string $search = null, $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\DomainSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\ListDomainsResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteDomainResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\DeleteDomainResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - domainSchemas: $obj); - $sdk = $this; - - $response->next = function () use ($sdk, $request, $responseData, $archived, $search, $pageSize): ?Operations\ListDomainsResponse { - $page = $request != null ? $request->page : 0; - $nextPage = $page + 1; - if (! $responseData) { - return null; - } - $results = json_decode($responseData, true); - if ($results == null || ! is_array($results)) { - return null; - } - if (count($results) === 0) { - return null; - } - $limit = $request != null ? $request->pageSize : 0; - if (count($results) < $limit) { - return null; - } - - return $sdk->listIndividual( - archived: $archived, - search: $search, - page: $nextPage, - pageSize: $pageSize, - ); - }; - + object: $obj); return $response; } else { @@ -410,6 +373,7 @@ private function listIndividual(?bool $archived = null, ?string $search = null, throw new \Dub\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } } + /** * Retrieve a list of domains * @@ -419,47 +383,29 @@ private function listIndividual(?bool $archived = null, ?string $search = null, * @param ?string $search * @param ?float $page * @param ?float $pageSize - * @return \Generator - * @throws \Dub\Models\Errors\SDKException - */ - public function list(?bool $archived = null, ?string $search = null, ?float $page = null, ?float $pageSize = null): \Generator - { - $res = $this->listIndividual($archived, $search, $page, $pageSize); - while ($res !== null) { - yield $res; - $res = $res->next($res); - } - } - - /** - * Update a domain - * - * Update a domain for the authenticated workspace. - * - * @param string $slug - * @param ?Operations\UpdateDomainRequestBody $requestBody - * @return Operations\UpdateDomainResponse + * @return Operations\ListDomainsResponse * @throws \Dub\Models\Errors\SDKException */ - public function update(string $slug, ?Operations\UpdateDomainRequestBody $requestBody = null): Operations\UpdateDomainResponse + private function listIndividual(?bool $archived = null, ?string $search = null, ?float $page = null, ?float $pageSize = null): Operations\ListDomainsResponse { - $request = new Operations\UpdateDomainRequest( - slug: $slug, - requestBody: $requestBody, + $request = new Operations\ListDomainsRequest( + archived: $archived, + search: $search, + page: $page, + pageSize: $pageSize, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/domains/{slug}', Operations\UpdateDomainRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/domains'); $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); - if ($body !== null) { - $options = array_merge_recursive($options, $body); - } + + $qp = Utils\Utils::getQueryParams(Operations\ListDomainsRequest::class, $request, $urlOverride); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); - $hookContext = new HookContext('updateDomain', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('listDomains', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -485,12 +431,40 @@ public function update(string $slug, ?Operations\UpdateDomainRequestBody $reques $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\DomainSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\UpdateDomainResponse( + $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\DomainSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\ListDomainsResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - domainSchema: $obj); + domainSchemas: $obj); + $sdk = $this; + + $response->next = function () use ($sdk, $request, $responseData, $archived, $search, $pageSize): ?Operations\ListDomainsResponse { + $page = $request != null ? $request->page : 0; + $nextPage = $page + 1; + if (! $responseData) { + return null; + } + $results = json_decode($responseData, true); + if ($results == null || ! is_array($results)) { + return null; + } + if (count($results) === 0) { + return null; + } + $limit = $request != null ? $request->pageSize : 0; + if (count($results) < $limit) { + return null; + } + + return $sdk->listIndividual( + archived: $archived, + search: $search, + page: $nextPage, + pageSize: $pageSize, + ); + }; + return $response; } else { @@ -601,29 +575,55 @@ public function update(string $slug, ?Operations\UpdateDomainRequestBody $reques throw new \Dub\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } } + /** + * Retrieve a list of domains + * + * Retrieve a list of domains associated with the authenticated workspace. + * + * @param ?bool $archived + * @param ?string $search + * @param ?float $page + * @param ?float $pageSize + * @return \Generator + * @throws \Dub\Models\Errors\SDKException + */ + public function list(?bool $archived = null, ?string $search = null, ?float $page = null, ?float $pageSize = null): \Generator + { + $res = $this->listIndividual($archived, $search, $page, $pageSize); + while ($res !== null) { + yield $res; + $res = $res->next($res); + } + } /** - * Delete a domain + * Update a domain * - * Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain. + * Update a domain for the authenticated workspace. * * @param string $slug - * @return Operations\DeleteDomainResponse + * @param ?Operations\UpdateDomainRequestBody $requestBody + * @return Operations\UpdateDomainResponse * @throws \Dub\Models\Errors\SDKException */ - public function delete(string $slug): Operations\DeleteDomainResponse + public function update(string $slug, ?Operations\UpdateDomainRequestBody $requestBody = null): Operations\UpdateDomainResponse { - $request = new Operations\DeleteDomainRequest( + $request = new Operations\UpdateDomainRequest( slug: $slug, + requestBody: $requestBody, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/domains/{slug}', Operations\DeleteDomainRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/domains/{slug}', Operations\UpdateDomainRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); - $hookContext = new HookContext('deleteDomain', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext('updateDomain', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -650,12 +650,12 @@ public function delete(string $slug): Operations\DeleteDomainResponse $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteDomainResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\DeleteDomainResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\DomainSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\UpdateDomainResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - object: $obj); + domainSchema: $obj); return $response; } else { diff --git a/src/Hooks/AfterErrorContext.php b/src/Hooks/AfterErrorContext.php index f3dba86..4144ab6 100644 --- a/src/Hooks/AfterErrorContext.php +++ b/src/Hooks/AfterErrorContext.php @@ -15,4 +15,18 @@ public function __construct(HookContext $hookCtx) { parent::__construct($hookCtx->operationID, $hookCtx->oauth2Scopes, $hookCtx->securitySource); } + + /** + * @param string $name + * @param array $args + * @return mixed + */ + public function __call($name, $args): mixed + { + if ($name === 'securitySource') { + return call_user_func_array($this->securitySource, $args); + } + + return null; + } } diff --git a/src/Hooks/BeforeRequestContext.php b/src/Hooks/BeforeRequestContext.php index dcb577b..90a3f5d 100644 --- a/src/Hooks/BeforeRequestContext.php +++ b/src/Hooks/BeforeRequestContext.php @@ -15,4 +15,18 @@ public function __construct(HookContext $hookCtx) { parent::__construct($hookCtx->operationID, $hookCtx->oauth2Scopes, $hookCtx->securitySource); } + + /** + * @param string $name + * @param array $args + * @return mixed + */ + public function __call($name, $args): mixed + { + if ($name === 'securitySource') { + return call_user_func_array($this->securitySource, $args); + } + + return null; + } } diff --git a/src/Hooks/Credentials.php b/src/Hooks/Credentials.php new file mode 100644 index 0000000..c76e506 --- /dev/null +++ b/src/Hooks/Credentials.php @@ -0,0 +1,24 @@ +clientID = $clientID; + $this->clientSecret = $clientSecret; + $this->tokenURL = $tokenURL; + } +} diff --git a/src/Hooks/HookContext.php b/src/Hooks/HookContext.php index b02730f..0d51dab 100644 --- a/src/Hooks/HookContext.php +++ b/src/Hooks/HookContext.php @@ -35,4 +35,17 @@ public function __construct(string $operationID, ?array $oauth2Scopes, ?\Closure $this->oauth2Scopes = $oauth2Scopes; $this->securitySource = $securitySource; } + /** + * @param string $name + * @param array $args + * @return mixed + */ + public function __call($name, $args): mixed + { + if ($name === 'securitySource') { + return call_user_func_array($this->securitySource, $args); + } + + return null; + } } diff --git a/src/Hooks/Session.php b/src/Hooks/Session.php new file mode 100644 index 0000000..09da5e5 --- /dev/null +++ b/src/Hooks/Session.php @@ -0,0 +1,37 @@ + scopes + */ + public array $scopes; + public ?LocalTime $expiresAt; + + /** + * @param Credentials $credentials + * @param string $token + * @param array $scopes + * @param ?LocalTime $expiresAt + */ + public function __construct(Credentials $credentials, string $token, array $scopes, ?LocalTime $expiresAt = null) + { + $this->credentials = $credentials; + $this->token = $token; + $this->scopes = $scopes; + $this->expiresAt = $expiresAt; + } +} diff --git a/src/Hooks/TokenResponse.php b/src/Hooks/TokenResponse.php new file mode 100644 index 0000000..2f4ceab --- /dev/null +++ b/src/Hooks/TokenResponse.php @@ -0,0 +1,17 @@ + $request + * @return Operations\BulkCreateLinksResponse * @throws \Dub\Models\Errors\SDKException */ - public function create(?Operations\CreateLinkRequestBody $request = null): Operations\CreateLinkResponse + public function createMany(?array $request = null): Operations\BulkCreateLinksResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links'); + $url = Utils\Utils::generateUrl($baseUrl, '/links/bulk'); $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); @@ -65,7 +65,7 @@ public function create(?Operations\CreateLinkRequestBody $request = null): Opera $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); - $hookContext = new HookContext('createLink', null, $this->sdkConfiguration->securitySource); + $hookContext = new HookContext('bulkCreateLinks', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -92,12 +92,12 @@ public function create(?Operations\CreateLinkRequestBody $request = null): Opera $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\LinkSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\CreateLinkResponse( + $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\LinkSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\BulkCreateLinksResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - linkSchema: $obj); + linkSchemas: $obj); return $response; } else { @@ -210,26 +210,29 @@ public function create(?Operations\CreateLinkRequestBody $request = null): Opera } /** - * Retrieve a list of links + * Bulk delete links * - * Retrieve a paginated list of links for the authenticated workspace. + * Bulk delete up to 100 links for the authenticated workspace. * - * @param ?Operations\GetLinksRequest $request - * @return Operations\GetLinksResponse + * @param array $linkIds + * @return Operations\BulkDeleteLinksResponse * @throws \Dub\Models\Errors\SDKException */ - private function listIndividual(?Operations\GetLinksRequest $request = null): Operations\GetLinksResponse + public function deleteMany(array $linkIds): Operations\BulkDeleteLinksResponse { + $request = new Operations\BulkDeleteLinksRequest( + linkIds: $linkIds, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links'); + $url = Utils\Utils::generateUrl($baseUrl, '/links/bulk'); $urlOverride = null; $options = ['http_errors' => false]; - $qp = Utils\Utils::getQueryParams(Operations\GetLinksRequest::class, $request, $urlOverride); + $qp = Utils\Utils::getQueryParams(Operations\BulkDeleteLinksRequest::class, $request, $urlOverride); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); - $hookContext = new HookContext('getLinks', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('bulkDeleteLinks', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); @@ -257,49 +260,12 @@ private function listIndividual(?Operations\GetLinksRequest $request = null): Op $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\LinkSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\GetLinksResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\BulkDeleteLinksResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\BulkDeleteLinksResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - linkSchemas: $obj); - $sdk = $this; - - $response->next = function () use ($sdk, $request, $responseData): ?Operations\GetLinksResponse { - $page = $request != null ? $request->page : 0; - $nextPage = $page + 1; - if (! $responseData) { - return null; - } - $results = json_decode($responseData, true); - if ($results == null || ! is_array($results)) { - return null; - } - if (count($results) === 0) { - return null; - } - $limit = $request != null ? $request->pageSize : 0; - if (count($results) < $limit) { - return null; - } - - return $sdk->listIndividual( - request: new Operations\GetLinksRequest( - domain: $request != null ? $request->domain : null, - tagId: $request != null ? $request->tagId : null, - tagIds: $request != null ? $request->tagIds : null, - tagNames: $request != null ? $request->tagNames : null, - search: $request != null ? $request->search : null, - userId: $request != null ? $request->userId : null, - showArchived: $request != null ? $request->showArchived : null, - withTags: $request != null ? $request->withTags : null, - sort: $request != null ? $request->sort : null, - page: $nextPage, - pageSize: $request != null ? $request->pageSize : null, - ), - ); - }; - + object: $obj); return $response; } else { @@ -410,47 +376,31 @@ private function listIndividual(?Operations\GetLinksRequest $request = null): Op throw new \Dub\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } } - /** - * Retrieve a list of links - * - * Retrieve a paginated list of links for the authenticated workspace. - * - * @param ?Operations\GetLinksRequest $request - * @return \Generator - * @throws \Dub\Models\Errors\SDKException - */ - public function list(?Operations\GetLinksRequest $request = null): \Generator - { - $res = $this->listIndividual($request); - while ($res !== null) { - yield $res; - $res = $res->next($res); - } - } /** - * Retrieve links count + * Bulk update links * - * Retrieve the number of links for the authenticated workspace. + * Bulk update up to 100 links with the same data for the authenticated workspace. * - * @param ?Operations\GetLinksCountRequest $request - * @return Operations\GetLinksCountResponse + * @param ?Operations\BulkUpdateLinksRequestBody $request + * @return Operations\BulkUpdateLinksResponse * @throws \Dub\Models\Errors\SDKException */ - public function count(?Operations\GetLinksCountRequest $request = null): Operations\GetLinksCountResponse + public function updateMany(?Operations\BulkUpdateLinksRequestBody $request = null): Operations\BulkUpdateLinksResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links/count'); + $url = Utils\Utils::generateUrl($baseUrl, '/links/bulk'); $urlOverride = null; $options = ['http_errors' => false]; - - $qp = Utils\Utils::getQueryParams(Operations\GetLinksCountRequest::class, $request, $urlOverride); + $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); - $hookContext = new HookContext('getLinksCount', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext('bulkUpdateLinks', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -476,12 +426,12 @@ public function count(?Operations\GetLinksCountRequest $request = null): Operati $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, 'float', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\GetLinksCountResponse( + $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\LinkSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\BulkUpdateLinksResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - number: $obj); + linkSchemas: $obj); return $response; } else { @@ -594,37 +544,29 @@ public function count(?Operations\GetLinksCountRequest $request = null): Operati } /** - * Retrieve a link + * Create a new link * - * Retrieve the info for a link. + * Create a new link for the authenticated workspace. * - * @param ?string $domain - * @param ?string $key - * @param ?string $linkId - * @param ?string $externalId - * @return Operations\GetLinkInfoResponse + * @param ?Operations\CreateLinkRequestBody $request + * @return Operations\CreateLinkResponse * @throws \Dub\Models\Errors\SDKException */ - public function get(?string $domain = null, ?string $key = null, ?string $linkId = null, ?string $externalId = null): Operations\GetLinkInfoResponse + public function create(?Operations\CreateLinkRequestBody $request = null): Operations\CreateLinkResponse { - $request = new Operations\GetLinkInfoRequest( - domain: $domain, - key: $key, - linkId: $linkId, - externalId: $externalId, - ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links/info'); + $url = Utils\Utils::generateUrl($baseUrl, '/links'); $urlOverride = null; $options = ['http_errors' => false]; - - $qp = Utils\Utils::getQueryParams(Operations\GetLinkInfoRequest::class, $request, $urlOverride); + $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); - $hookContext = new HookContext('getLinkInfo', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('createLink', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -651,7 +593,7 @@ public function get(?string $domain = null, ?string $key = null, ?string $linkId $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\LinkSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\GetLinkInfoResponse( + $response = new Operations\CreateLinkResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, @@ -768,33 +710,27 @@ public function get(?string $domain = null, ?string $key = null, ?string $linkId } /** - * Update a link + * Delete a link * - * Update a link for the authenticated workspace. If there's no change, returns it as it is. + * Delete a link for the authenticated workspace. * * @param string $linkId - * @param ?Operations\UpdateLinkRequestBody $requestBody - * @return Operations\UpdateLinkResponse + * @return Operations\DeleteLinkResponse * @throws \Dub\Models\Errors\SDKException */ - public function update(string $linkId, ?Operations\UpdateLinkRequestBody $requestBody = null): Operations\UpdateLinkResponse + public function delete(string $linkId): Operations\DeleteLinkResponse { - $request = new Operations\UpdateLinkRequest( + $request = new Operations\DeleteLinkRequest( linkId: $linkId, - requestBody: $requestBody, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links/{linkId}', Operations\UpdateLinkRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/links/{linkId}', Operations\DeleteLinkRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); - if ($body !== null) { - $options = array_merge_recursive($options, $body); - } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); - $hookContext = new HookContext('updateLink', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('deleteLink', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -821,12 +757,12 @@ public function update(string $linkId, ?Operations\UpdateLinkRequestBody $reques $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\LinkSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\UpdateLinkResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteLinkResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\DeleteLinkResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - linkSchema: $obj); + object: $obj); return $response; } else { @@ -939,28 +875,37 @@ public function update(string $linkId, ?Operations\UpdateLinkRequestBody $reques } /** - * Delete a link + * Retrieve a link * - * Delete a link for the authenticated workspace. + * Retrieve the info for a link. * - * @param string $linkId - * @return Operations\DeleteLinkResponse + * @param ?string $domain + * @param ?string $key + * @param ?string $linkId + * @param ?string $externalId + * @return Operations\GetLinkInfoResponse * @throws \Dub\Models\Errors\SDKException */ - public function delete(string $linkId): Operations\DeleteLinkResponse + public function get(?string $domain = null, ?string $key = null, ?string $linkId = null, ?string $externalId = null): Operations\GetLinkInfoResponse { - $request = new Operations\DeleteLinkRequest( + $request = new Operations\GetLinkInfoRequest( + domain: $domain, + key: $key, linkId: $linkId, + externalId: $externalId, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links/{linkId}', Operations\DeleteLinkRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/links/info'); $urlOverride = null; $options = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\GetLinkInfoRequest::class, $request, $urlOverride); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); - $hookContext = new HookContext('deleteLink', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('getLinkInfo', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -986,12 +931,12 @@ public function delete(string $linkId): Operations\DeleteLinkResponse $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteLinkResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\DeleteLinkResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\LinkSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\GetLinkInfoResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - object: $obj); + linkSchema: $obj); return $response; } else { @@ -1104,29 +1049,28 @@ public function delete(string $linkId): Operations\DeleteLinkResponse } /** - * Bulk create links + * Retrieve a list of links * - * Bulk create up to 100 links for the authenticated workspace. + * Retrieve a paginated list of links for the authenticated workspace. * - * @param ?array $request - * @return Operations\BulkCreateLinksResponse + * @param ?Operations\GetLinksRequest $request + * @return Operations\GetLinksResponse * @throws \Dub\Models\Errors\SDKException */ - public function createMany(?array $request = null): Operations\BulkCreateLinksResponse + private function listIndividual(?Operations\GetLinksRequest $request = null): Operations\GetLinksResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links/bulk'); + $url = Utils\Utils::generateUrl($baseUrl, '/links'); $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); - if ($body !== null) { - $options = array_merge_recursive($options, $body); - } + + $qp = Utils\Utils::getQueryParams(Operations\GetLinksRequest::class, $request, $urlOverride); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); - $hookContext = new HookContext('bulkCreateLinks', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('getLinks', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -1153,11 +1097,48 @@ public function createMany(?array $request = null): Operations\BulkCreateLinksRe $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\LinkSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\BulkCreateLinksResponse( + $response = new Operations\GetLinksResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, linkSchemas: $obj); + $sdk = $this; + + $response->next = function () use ($sdk, $request, $responseData): ?Operations\GetLinksResponse { + $page = $request != null ? $request->page : 0; + $nextPage = $page + 1; + if (! $responseData) { + return null; + } + $results = json_decode($responseData, true); + if ($results == null || ! is_array($results)) { + return null; + } + if (count($results) === 0) { + return null; + } + $limit = $request != null ? $request->pageSize : 0; + if (count($results) < $limit) { + return null; + } + + return $sdk->listIndividual( + request: new Operations\GetLinksRequest( + domain: $request != null ? $request->domain : null, + tagId: $request != null ? $request->tagId : null, + tagIds: $request != null ? $request->tagIds : null, + tagNames: $request != null ? $request->tagNames : null, + search: $request != null ? $request->search : null, + userId: $request != null ? $request->userId : null, + showArchived: $request != null ? $request->showArchived : null, + withTags: $request != null ? $request->withTags : null, + sort: $request != null ? $request->sort : null, + page: $nextPage, + pageSize: $request != null ? $request->pageSize : null, + ), + ); + }; + return $response; } else { @@ -1268,31 +1249,47 @@ public function createMany(?array $request = null): Operations\BulkCreateLinksRe throw new \Dub\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } } + /** + * Retrieve a list of links + * + * Retrieve a paginated list of links for the authenticated workspace. + * + * @param ?Operations\GetLinksRequest $request + * @return \Generator + * @throws \Dub\Models\Errors\SDKException + */ + public function list(?Operations\GetLinksRequest $request = null): \Generator + { + $res = $this->listIndividual($request); + while ($res !== null) { + yield $res; + $res = $res->next($res); + } + } /** - * Bulk update links + * Retrieve links count * - * Bulk update up to 100 links with the same data for the authenticated workspace. + * Retrieve the number of links for the authenticated workspace. * - * @param ?Operations\BulkUpdateLinksRequestBody $request - * @return Operations\BulkUpdateLinksResponse + * @param ?Operations\GetLinksCountRequest $request + * @return Operations\GetLinksCountResponse * @throws \Dub\Models\Errors\SDKException */ - public function updateMany(?Operations\BulkUpdateLinksRequestBody $request = null): Operations\BulkUpdateLinksResponse + public function count(?Operations\GetLinksCountRequest $request = null): Operations\GetLinksCountResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links/bulk'); + $url = Utils\Utils::generateUrl($baseUrl, '/links/count'); $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); - if ($body !== null) { - $options = array_merge_recursive($options, $body); - } + + $qp = Utils\Utils::getQueryParams(Operations\GetLinksCountRequest::class, $request, $urlOverride); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); - $hookContext = new HookContext('bulkUpdateLinks', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('getLinksCount', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -1318,12 +1315,12 @@ public function updateMany(?Operations\BulkUpdateLinksRequestBody $request = nul $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\LinkSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\BulkUpdateLinksResponse( + $obj = $serializer->deserialize($responseData, 'float', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\GetLinksCountResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - linkSchemas: $obj); + number: $obj); return $response; } else { @@ -1436,31 +1433,34 @@ public function updateMany(?Operations\BulkUpdateLinksRequestBody $request = nul } /** - * Bulk delete links + * Update a link * - * Bulk delete up to 100 links for the authenticated workspace. + * Update a link for the authenticated workspace. If there's no change, returns it as it is. * - * @param array $linkIds - * @return Operations\BulkDeleteLinksResponse + * @param string $linkId + * @param ?Operations\UpdateLinkRequestBody $requestBody + * @return Operations\UpdateLinkResponse * @throws \Dub\Models\Errors\SDKException */ - public function deleteMany(array $linkIds): Operations\BulkDeleteLinksResponse + public function update(string $linkId, ?Operations\UpdateLinkRequestBody $requestBody = null): Operations\UpdateLinkResponse { - $request = new Operations\BulkDeleteLinksRequest( - linkIds: $linkIds, + $request = new Operations\UpdateLinkRequest( + linkId: $linkId, + requestBody: $requestBody, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/links/bulk'); + $url = Utils\Utils::generateUrl($baseUrl, '/links/{linkId}', Operations\UpdateLinkRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; - - $qp = Utils\Utils::getQueryParams(Operations\BulkDeleteLinksRequest::class, $request, $urlOverride); + $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); - $hookContext = new HookContext('bulkDeleteLinks', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext('updateLink', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -1486,12 +1486,12 @@ public function deleteMany(array $linkIds): Operations\BulkDeleteLinksResponse $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\BulkDeleteLinksResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\BulkDeleteLinksResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\LinkSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\UpdateLinkResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - object: $obj); + linkSchema: $obj); return $response; } else { diff --git a/src/Models/Components/Click.php b/src/Models/Components/Click.php index b5b558f..e989aa6 100644 --- a/src/Models/Components/Click.php +++ b/src/Models/Components/Click.php @@ -90,18 +90,18 @@ class Click /** * - * @var ?bool $qr + * @var string $ip */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $qr = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] + public string $ip; /** * - * @var string $ip + * @var ?bool $qr */ - #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] - public string $ip; + #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $qr = null; /** * @param string $id diff --git a/src/Models/Components/ClickEvent.php b/src/Models/Components/ClickEvent.php index 12fb370..f86dabe 100644 --- a/src/Models/Components/ClickEvent.php +++ b/src/Models/Components/ClickEvent.php @@ -19,14 +19,6 @@ class ClickEvent #[\Speakeasy\Serializer\Annotation\Type('\Dub\Models\Components\Event')] public Event $event; - /** - * - * @var ?string $timestamp - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('timestamp')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $timestamp = null; - /** * * @var Click $click @@ -160,6 +152,14 @@ class ClickEvent #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] public string $ip; + /** + * + * @var ?string $timestamp + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('timestamp')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $timestamp = null; + /** * @param Event $event * @param Click $click diff --git a/src/Models/Components/Customer.php b/src/Models/Components/Customer.php index aa73417..ac79e93 100644 --- a/src/Models/Components/Customer.php +++ b/src/Models/Components/Customer.php @@ -35,6 +35,14 @@ class Customer #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * The date the customer was created. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + /** * Email of the customer. * @@ -53,14 +61,6 @@ class Customer #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * The date the customer was created. - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - /** * @param string $id * @param string $externalId diff --git a/src/Models/Components/Data.php b/src/Models/Components/Data.php index 70c1e7a..e8e5386 100644 --- a/src/Models/Components/Data.php +++ b/src/Models/Components/Data.php @@ -42,6 +42,76 @@ class Data #[\Speakeasy\Serializer\Annotation\SerializedName('url')] public string $url; + /** + * + * @var string $expiresAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] + public string $expiresAt; + + /** + * The IDs of the webhooks that the short link is associated with. + * + * @var array $webhookIds + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $webhookIds; + + /** + * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). + * + * @var string $shortLink + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] + public string $shortLink; + + /** + * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). + * + * @var string $qrCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] + public string $qrCode; + + /** + * The workspace ID of the short link. + * + * @var string $workspaceId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] + public string $workspaceId; + + /** + * + * @var string $lastClicked + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] + public string $lastClicked; + + /** + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + + /** + * + * @var string $updatedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; + + /** + * The project ID of the short link. This field is deprecated – use `workspaceId` instead. + * + * @var string $projectId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] + public string $projectId; + /** * * @var ?bool $trackConversion @@ -66,13 +136,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $archived = null; - /** - * - * @var string $expiresAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] - public string $expiresAt; - /** * * @var ?string $expiredUrl @@ -195,15 +258,6 @@ class Data #[\Speakeasy\Serializer\Annotation\Type('array<\Dub\Models\Components\TagSchema>|null')] public ?array $tags; - /** - * The IDs of the webhooks that the short link is associated with. - * - * @var array $webhookIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] - #[\Speakeasy\Serializer\Annotation\Type('array')] - public array $webhookIds; - /** * The comments for the short link. * @@ -212,22 +266,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SerializedName('comments')] public ?string $comments; - /** - * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). - * - * @var string $shortLink - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] - public string $shortLink; - - /** - * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). - * - * @var string $qrCode - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] - public string $qrCode; - /** * The UTM source of the short link. * @@ -276,12 +314,12 @@ class Data public ?string $userId; /** - * The workspace ID of the short link. + * The ID of the program the short link is associated with. * - * @var string $workspaceId + * @var ?string $programId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] - public string $workspaceId; + #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] + public ?string $programId; /** * The number of clicks on the short link. @@ -292,13 +330,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $clicks = null; - /** - * - * @var string $lastClicked - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] - public string $lastClicked; - /** * [BETA]: The number of leads the short links has generated. * @@ -326,37 +357,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $saleAmount = null; - /** - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - - /** - * - * @var string $updatedAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] - public string $updatedAt; - - /** - * The project ID of the short link. This field is deprecated – use `workspaceId` instead. - * - * @var string $projectId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] - public string $projectId; - - /** - * The ID of the program the short link is associated with. - * - * @var ?string $programId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] - public ?string $programId; - /** * @param string $id * @param string $domain @@ -442,10 +442,10 @@ public function __construct(string $id, string $domain, string $key, string $url $this->utmTerm = $utmTerm; $this->utmContent = $utmContent; $this->userId = $userId; + $this->programId = $programId; $this->clicks = $clicks; $this->leads = $leads; $this->sales = $sales; $this->saleAmount = $saleAmount; - $this->programId = $programId; } } \ No newline at end of file diff --git a/src/Models/Components/DomainSchema.php b/src/Models/Components/DomainSchema.php index 8f04307..ae24739 100644 --- a/src/Models/Components/DomainSchema.php +++ b/src/Models/Components/DomainSchema.php @@ -28,31 +28,20 @@ class DomainSchema public string $slug; /** - * Whether the domain is verified. - * - * @var ?bool $verified - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('verified')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $verified = null; - - /** - * Whether the domain is the primary domain for the workspace. + * The date the domain was created. * - * @var ?bool $primary + * @var string $createdAt */ - #[\Speakeasy\Serializer\Annotation\SerializedName('primary')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $primary = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; /** - * Whether the domain is archived. + * The date the domain was last updated. * - * @var ?bool $archived + * @var string $updatedAt */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; /** * Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened. @@ -87,29 +76,40 @@ class DomainSchema public ?string $logo; /** - * The date the domain was created. + * The registered domain record. * - * @var string $createdAt + * @var ?RegisteredDomain $registeredDomain */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; + #[\Speakeasy\Serializer\Annotation\SerializedName('registeredDomain')] + #[\Speakeasy\Serializer\Annotation\Type('\Dub\Models\Components\RegisteredDomain|null')] + public ?RegisteredDomain $registeredDomain; /** - * The date the domain was last updated. + * Whether the domain is verified. * - * @var string $updatedAt + * @var ?bool $verified */ - #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] - public string $updatedAt; + #[\Speakeasy\Serializer\Annotation\SerializedName('verified')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $verified = null; /** - * The registered domain record. + * Whether the domain is the primary domain for the workspace. * - * @var ?RegisteredDomain $registeredDomain + * @var ?bool $primary */ - #[\Speakeasy\Serializer\Annotation\SerializedName('registeredDomain')] - #[\Speakeasy\Serializer\Annotation\Type('\Dub\Models\Components\RegisteredDomain|null')] - public ?RegisteredDomain $registeredDomain; + #[\Speakeasy\Serializer\Annotation\SerializedName('primary')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $primary = null; + + /** + * Whether the domain is archived. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; /** * @param string $id @@ -131,13 +131,13 @@ public function __construct(string $id, string $slug, string $createdAt, string $this->slug = $slug; $this->createdAt = $createdAt; $this->updatedAt = $updatedAt; - $this->verified = $verified; - $this->primary = $primary; - $this->archived = $archived; $this->placeholder = $placeholder; $this->expiredUrl = $expiredUrl; $this->notFoundUrl = $notFoundUrl; $this->logo = $logo; $this->registeredDomain = $registeredDomain; + $this->verified = $verified; + $this->primary = $primary; + $this->archived = $archived; } } \ No newline at end of file diff --git a/src/Models/Components/LeadCreatedEventClick.php b/src/Models/Components/LeadCreatedEventClick.php index ef37389..68d5604 100644 --- a/src/Models/Components/LeadCreatedEventClick.php +++ b/src/Models/Components/LeadCreatedEventClick.php @@ -90,18 +90,18 @@ class LeadCreatedEventClick /** * - * @var ?bool $qr + * @var string $ip */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $qr = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] + public string $ip; /** * - * @var string $ip + * @var ?bool $qr */ - #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] - public string $ip; + #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $qr = null; /** * @param string $id diff --git a/src/Models/Components/LeadCreatedEventLink.php b/src/Models/Components/LeadCreatedEventLink.php index abbe636..6e02d3e 100644 --- a/src/Models/Components/LeadCreatedEventLink.php +++ b/src/Models/Components/LeadCreatedEventLink.php @@ -42,6 +42,76 @@ class LeadCreatedEventLink #[\Speakeasy\Serializer\Annotation\SerializedName('url')] public string $url; + /** + * + * @var string $expiresAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] + public string $expiresAt; + + /** + * The IDs of the webhooks that the short link is associated with. + * + * @var array $webhookIds + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $webhookIds; + + /** + * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). + * + * @var string $shortLink + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] + public string $shortLink; + + /** + * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). + * + * @var string $qrCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] + public string $qrCode; + + /** + * The workspace ID of the short link. + * + * @var string $workspaceId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] + public string $workspaceId; + + /** + * + * @var string $lastClicked + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] + public string $lastClicked; + + /** + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + + /** + * + * @var string $updatedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; + + /** + * The project ID of the short link. This field is deprecated – use `workspaceId` instead. + * + * @var string $projectId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] + public string $projectId; + /** * * @var ?bool $trackConversion @@ -66,13 +136,6 @@ class LeadCreatedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $archived = null; - /** - * - * @var string $expiresAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] - public string $expiresAt; - /** * * @var ?string $expiredUrl @@ -195,15 +258,6 @@ class LeadCreatedEventLink #[\Speakeasy\Serializer\Annotation\Type('array<\Dub\Models\Components\TagSchema>|null')] public ?array $tags; - /** - * The IDs of the webhooks that the short link is associated with. - * - * @var array $webhookIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] - #[\Speakeasy\Serializer\Annotation\Type('array')] - public array $webhookIds; - /** * The comments for the short link. * @@ -212,22 +266,6 @@ class LeadCreatedEventLink #[\Speakeasy\Serializer\Annotation\SerializedName('comments')] public ?string $comments; - /** - * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). - * - * @var string $shortLink - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] - public string $shortLink; - - /** - * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). - * - * @var string $qrCode - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] - public string $qrCode; - /** * The UTM source of the short link. * @@ -276,12 +314,12 @@ class LeadCreatedEventLink public ?string $userId; /** - * The workspace ID of the short link. + * The ID of the program the short link is associated with. * - * @var string $workspaceId + * @var ?string $programId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] - public string $workspaceId; + #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] + public ?string $programId; /** * The number of clicks on the short link. @@ -292,13 +330,6 @@ class LeadCreatedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $clicks = null; - /** - * - * @var string $lastClicked - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] - public string $lastClicked; - /** * [BETA]: The number of leads the short links has generated. * @@ -326,37 +357,6 @@ class LeadCreatedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $saleAmount = null; - /** - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - - /** - * - * @var string $updatedAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] - public string $updatedAt; - - /** - * The project ID of the short link. This field is deprecated – use `workspaceId` instead. - * - * @var string $projectId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] - public string $projectId; - - /** - * The ID of the program the short link is associated with. - * - * @var ?string $programId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] - public ?string $programId; - /** * @param string $id * @param string $domain @@ -442,10 +442,10 @@ public function __construct(string $id, string $domain, string $key, string $url $this->utmTerm = $utmTerm; $this->utmContent = $utmContent; $this->userId = $userId; + $this->programId = $programId; $this->clicks = $clicks; $this->leads = $leads; $this->sales = $sales; $this->saleAmount = $saleAmount; - $this->programId = $programId; } } \ No newline at end of file diff --git a/src/Models/Components/Link.php b/src/Models/Components/Link.php index 2678a03..af587cf 100644 --- a/src/Models/Components/Link.php +++ b/src/Models/Components/Link.php @@ -42,6 +42,76 @@ class Link #[\Speakeasy\Serializer\Annotation\SerializedName('url')] public string $url; + /** + * + * @var string $expiresAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] + public string $expiresAt; + + /** + * The IDs of the webhooks that the short link is associated with. + * + * @var array $webhookIds + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $webhookIds; + + /** + * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). + * + * @var string $shortLink + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] + public string $shortLink; + + /** + * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). + * + * @var string $qrCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] + public string $qrCode; + + /** + * The workspace ID of the short link. + * + * @var string $workspaceId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] + public string $workspaceId; + + /** + * + * @var string $lastClicked + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] + public string $lastClicked; + + /** + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + + /** + * + * @var string $updatedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; + + /** + * The project ID of the short link. This field is deprecated – use `workspaceId` instead. + * + * @var string $projectId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] + public string $projectId; + /** * * @var ?bool $trackConversion @@ -66,13 +136,6 @@ class Link #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $archived = null; - /** - * - * @var string $expiresAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] - public string $expiresAt; - /** * * @var ?string $expiredUrl @@ -195,15 +258,6 @@ class Link #[\Speakeasy\Serializer\Annotation\Type('array<\Dub\Models\Components\TagSchema>|null')] public ?array $tags; - /** - * The IDs of the webhooks that the short link is associated with. - * - * @var array $webhookIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] - #[\Speakeasy\Serializer\Annotation\Type('array')] - public array $webhookIds; - /** * The comments for the short link. * @@ -212,22 +266,6 @@ class Link #[\Speakeasy\Serializer\Annotation\SerializedName('comments')] public ?string $comments; - /** - * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). - * - * @var string $shortLink - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] - public string $shortLink; - - /** - * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). - * - * @var string $qrCode - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] - public string $qrCode; - /** * The UTM source of the short link. * @@ -276,12 +314,12 @@ class Link public ?string $userId; /** - * The workspace ID of the short link. + * The ID of the program the short link is associated with. * - * @var string $workspaceId + * @var ?string $programId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] - public string $workspaceId; + #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] + public ?string $programId; /** * The number of clicks on the short link. @@ -292,13 +330,6 @@ class Link #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $clicks = null; - /** - * - * @var string $lastClicked - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] - public string $lastClicked; - /** * [BETA]: The number of leads the short links has generated. * @@ -326,37 +357,6 @@ class Link #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $saleAmount = null; - /** - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - - /** - * - * @var string $updatedAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] - public string $updatedAt; - - /** - * The project ID of the short link. This field is deprecated – use `workspaceId` instead. - * - * @var string $projectId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] - public string $projectId; - - /** - * The ID of the program the short link is associated with. - * - * @var ?string $programId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] - public ?string $programId; - /** * @param string $id * @param string $domain @@ -442,10 +442,10 @@ public function __construct(string $id, string $domain, string $key, string $url $this->utmTerm = $utmTerm; $this->utmContent = $utmContent; $this->userId = $userId; + $this->programId = $programId; $this->clicks = $clicks; $this->leads = $leads; $this->sales = $sales; $this->saleAmount = $saleAmount; - $this->programId = $programId; } } \ No newline at end of file diff --git a/src/Models/Components/LinkClickedEventClick.php b/src/Models/Components/LinkClickedEventClick.php index 84ea2de..6b30728 100644 --- a/src/Models/Components/LinkClickedEventClick.php +++ b/src/Models/Components/LinkClickedEventClick.php @@ -90,18 +90,18 @@ class LinkClickedEventClick /** * - * @var ?bool $qr + * @var string $ip */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $qr = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] + public string $ip; /** * - * @var string $ip + * @var ?bool $qr */ - #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] - public string $ip; + #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $qr = null; /** * @param string $id diff --git a/src/Models/Components/LinkClickedEventLink.php b/src/Models/Components/LinkClickedEventLink.php index bb2e30d..d9a5544 100644 --- a/src/Models/Components/LinkClickedEventLink.php +++ b/src/Models/Components/LinkClickedEventLink.php @@ -42,6 +42,76 @@ class LinkClickedEventLink #[\Speakeasy\Serializer\Annotation\SerializedName('url')] public string $url; + /** + * + * @var string $expiresAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] + public string $expiresAt; + + /** + * The IDs of the webhooks that the short link is associated with. + * + * @var array $webhookIds + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $webhookIds; + + /** + * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). + * + * @var string $shortLink + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] + public string $shortLink; + + /** + * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). + * + * @var string $qrCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] + public string $qrCode; + + /** + * The workspace ID of the short link. + * + * @var string $workspaceId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] + public string $workspaceId; + + /** + * + * @var string $lastClicked + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] + public string $lastClicked; + + /** + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + + /** + * + * @var string $updatedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; + + /** + * The project ID of the short link. This field is deprecated – use `workspaceId` instead. + * + * @var string $projectId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] + public string $projectId; + /** * * @var ?bool $trackConversion @@ -66,13 +136,6 @@ class LinkClickedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $archived = null; - /** - * - * @var string $expiresAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] - public string $expiresAt; - /** * * @var ?string $expiredUrl @@ -195,15 +258,6 @@ class LinkClickedEventLink #[\Speakeasy\Serializer\Annotation\Type('array<\Dub\Models\Components\TagSchema>|null')] public ?array $tags; - /** - * The IDs of the webhooks that the short link is associated with. - * - * @var array $webhookIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] - #[\Speakeasy\Serializer\Annotation\Type('array')] - public array $webhookIds; - /** * The comments for the short link. * @@ -212,22 +266,6 @@ class LinkClickedEventLink #[\Speakeasy\Serializer\Annotation\SerializedName('comments')] public ?string $comments; - /** - * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). - * - * @var string $shortLink - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] - public string $shortLink; - - /** - * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). - * - * @var string $qrCode - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] - public string $qrCode; - /** * The UTM source of the short link. * @@ -276,12 +314,12 @@ class LinkClickedEventLink public ?string $userId; /** - * The workspace ID of the short link. + * The ID of the program the short link is associated with. * - * @var string $workspaceId + * @var ?string $programId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] - public string $workspaceId; + #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] + public ?string $programId; /** * The number of clicks on the short link. @@ -292,13 +330,6 @@ class LinkClickedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $clicks = null; - /** - * - * @var string $lastClicked - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] - public string $lastClicked; - /** * [BETA]: The number of leads the short links has generated. * @@ -326,37 +357,6 @@ class LinkClickedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $saleAmount = null; - /** - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - - /** - * - * @var string $updatedAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] - public string $updatedAt; - - /** - * The project ID of the short link. This field is deprecated – use `workspaceId` instead. - * - * @var string $projectId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] - public string $projectId; - - /** - * The ID of the program the short link is associated with. - * - * @var ?string $programId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] - public ?string $programId; - /** * @param string $id * @param string $domain @@ -442,10 +442,10 @@ public function __construct(string $id, string $domain, string $key, string $url $this->utmTerm = $utmTerm; $this->utmContent = $utmContent; $this->userId = $userId; + $this->programId = $programId; $this->clicks = $clicks; $this->leads = $leads; $this->sales = $sales; $this->saleAmount = $saleAmount; - $this->programId = $programId; } } \ No newline at end of file diff --git a/src/Models/Components/LinkSchema.php b/src/Models/Components/LinkSchema.php index 343a43b..5958542 100644 --- a/src/Models/Components/LinkSchema.php +++ b/src/Models/Components/LinkSchema.php @@ -44,30 +44,70 @@ class LinkSchema public string $url; /** - * [BETA] Whether to track conversions for the short link. + * The IDs of the webhooks that the short link is associated with. * - * @var ?bool $trackConversion + * @var array $webhookIds */ - #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $trackConversion = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $webhookIds; /** - * This is the ID of the link in your database that is unique across your workspace. If set, it can be used to identify the link in future API requests. Must be prefixed with 'ext_' when passed as a query parameter. + * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). * - * @var ?string $externalId + * @var string $shortLink */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - public ?string $externalId; + #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] + public string $shortLink; /** - * Whether the short link is archived. + * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). * - * @var ?bool $archived + * @var string $qrCode */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] + public string $qrCode; + + /** + * The workspace ID of the short link. + * + * @var string $workspaceId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] + public string $workspaceId; + + /** + * The date and time when the short link was created. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + + /** + * The date and time when the short link was last updated. + * + * @var string $updatedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; + + /** + * The project ID of the short link. This field is deprecated – use `workspaceId` instead. + * + * @var string $projectId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] + public string $projectId; + + /** + * This is the ID of the link in your database that is unique across your workspace. If set, it can be used to identify the link in future API requests. Must be prefixed with 'ext_' when passed as a query parameter. + * + * @var ?string $externalId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] + public ?string $externalId; /** * The date and time when the short link will expire in ISO-8601 format. @@ -93,15 +133,6 @@ class LinkSchema #[\Speakeasy\Serializer\Annotation\SerializedName('password')] public ?string $password; - /** - * Whether the short link uses Custom Social Media Cards feature. - * - * @var ?bool $proxy - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $proxy = null; - /** * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. * @@ -134,24 +165,6 @@ class LinkSchema #[\Speakeasy\Serializer\Annotation\SerializedName('video')] public ?string $video; - /** - * Whether the short link uses link cloaking. - * - * @var ?bool $rewrite - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $rewrite = null; - - /** - * Whether to allow search engines to index the short link. - * - * @var ?bool $doIndex - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $doIndex = null; - /** * The iOS destination URL for the short link for iOS device targeting. * @@ -177,15 +190,6 @@ class LinkSchema #[\Speakeasy\Serializer\Annotation\Type('\Dub\Models\Components\Geo|null')] public ?Geo $geo; - /** - * Whether the short link's stats are publicly accessible. - * - * @var ?bool $publicStats - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $publicStats = null; - /** * The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead. * @@ -204,15 +208,6 @@ class LinkSchema #[\Speakeasy\Serializer\Annotation\Type('array<\Dub\Models\Components\TagSchema>|null')] public ?array $tags; - /** - * The IDs of the webhooks that the short link is associated with. - * - * @var array $webhookIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] - #[\Speakeasy\Serializer\Annotation\Type('array')] - public array $webhookIds; - /** * The comments for the short link. * @@ -221,22 +216,6 @@ class LinkSchema #[\Speakeasy\Serializer\Annotation\SerializedName('comments')] public ?string $comments; - /** - * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). - * - * @var string $shortLink - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] - public string $shortLink; - - /** - * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). - * - * @var string $qrCode - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] - public string $qrCode; - /** * The UTM source of the short link. * @@ -286,89 +265,110 @@ class LinkSchema public ?string $userId; /** - * The workspace ID of the short link. + * The date and time when the short link was last clicked. * - * @var string $workspaceId + * @var ?string $lastClicked */ - #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] - public string $workspaceId; + #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] + public ?string $lastClicked; /** - * The number of clicks on the short link. + * The ID of the program the short link is associated with. * - * @var ?float $clicks + * @var ?string $programId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('clicks')] + #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] + public ?string $programId; + + /** + * [BETA] Whether to track conversions for the short link. + * + * @var ?bool $trackConversion + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?float $clicks = null; + public ?bool $trackConversion = null; /** - * The date and time when the short link was last clicked. + * Whether the short link is archived. * - * @var ?string $lastClicked + * @var ?bool $archived */ - #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] - public ?string $lastClicked; + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; /** - * [BETA]: The number of leads the short links has generated. + * Whether the short link uses Custom Social Media Cards feature. * - * @var ?float $leads + * @var ?bool $proxy */ - #[\Speakeasy\Serializer\Annotation\SerializedName('leads')] + #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?float $leads = null; + public ?bool $proxy = null; /** - * [BETA]: The number of sales the short links has generated. + * Whether the short link uses link cloaking. * - * @var ?float $sales + * @var ?bool $rewrite */ - #[\Speakeasy\Serializer\Annotation\SerializedName('sales')] + #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?float $sales = null; + public ?bool $rewrite = null; /** - * [BETA]: The total dollar amount of sales the short links has generated (in cents). + * Whether to allow search engines to index the short link. * - * @var ?float $saleAmount + * @var ?bool $doIndex */ - #[\Speakeasy\Serializer\Annotation\SerializedName('saleAmount')] + #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?float $saleAmount = null; + public ?bool $doIndex = null; /** - * The date and time when the short link was created. + * Whether the short link's stats are publicly accessible. * - * @var string $createdAt + * @var ?bool $publicStats */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; + #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $publicStats = null; /** - * The date and time when the short link was last updated. + * The number of clicks on the short link. * - * @var string $updatedAt + * @var ?float $clicks */ - #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] - public string $updatedAt; + #[\Speakeasy\Serializer\Annotation\SerializedName('clicks')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?float $clicks = null; /** - * The project ID of the short link. This field is deprecated – use `workspaceId` instead. + * [BETA]: The number of leads the short links has generated. * - * @var string $projectId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * @var ?float $leads */ - #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] - public string $projectId; + #[\Speakeasy\Serializer\Annotation\SerializedName('leads')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?float $leads = null; /** - * The ID of the program the short link is associated with. + * [BETA]: The number of sales the short links has generated. * - * @var ?string $programId + * @var ?float $sales */ - #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] - public ?string $programId; + #[\Speakeasy\Serializer\Annotation\SerializedName('sales')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?float $sales = null; + + /** + * [BETA]: The total dollar amount of sales the short links has generated (in cents). + * + * @var ?float $saleAmount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('saleAmount')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?float $saleAmount = null; /** * @param string $id @@ -428,23 +428,17 @@ public function __construct(string $id, string $domain, string $key, string $url $this->createdAt = $createdAt; $this->updatedAt = $updatedAt; $this->projectId = $projectId; - $this->trackConversion = $trackConversion; $this->externalId = $externalId; - $this->archived = $archived; $this->expiresAt = $expiresAt; $this->expiredUrl = $expiredUrl; $this->password = $password; - $this->proxy = $proxy; $this->title = $title; $this->description = $description; $this->image = $image; $this->video = $video; - $this->rewrite = $rewrite; - $this->doIndex = $doIndex; $this->ios = $ios; $this->android = $android; $this->geo = $geo; - $this->publicStats = $publicStats; $this->tagId = $tagId; $this->tags = $tags; $this->comments = $comments; @@ -454,11 +448,17 @@ public function __construct(string $id, string $domain, string $key, string $url $this->utmTerm = $utmTerm; $this->utmContent = $utmContent; $this->userId = $userId; - $this->clicks = $clicks; $this->lastClicked = $lastClicked; + $this->programId = $programId; + $this->trackConversion = $trackConversion; + $this->archived = $archived; + $this->proxy = $proxy; + $this->rewrite = $rewrite; + $this->doIndex = $doIndex; + $this->publicStats = $publicStats; + $this->clicks = $clicks; $this->leads = $leads; $this->sales = $sales; $this->saleAmount = $saleAmount; - $this->programId = $programId; } } \ No newline at end of file diff --git a/src/Models/Components/SaleCreatedEventClick.php b/src/Models/Components/SaleCreatedEventClick.php index 8bc2849..29daf7e 100644 --- a/src/Models/Components/SaleCreatedEventClick.php +++ b/src/Models/Components/SaleCreatedEventClick.php @@ -90,18 +90,18 @@ class SaleCreatedEventClick /** * - * @var ?bool $qr + * @var string $ip */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $qr = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] + public string $ip; /** * - * @var string $ip + * @var ?bool $qr */ - #[\Speakeasy\Serializer\Annotation\SerializedName('ip')] - public string $ip; + #[\Speakeasy\Serializer\Annotation\SerializedName('qr')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $qr = null; /** * @param string $id diff --git a/src/Models/Components/SaleCreatedEventCustomer.php b/src/Models/Components/SaleCreatedEventCustomer.php index 8a4da99..28628cd 100644 --- a/src/Models/Components/SaleCreatedEventCustomer.php +++ b/src/Models/Components/SaleCreatedEventCustomer.php @@ -35,6 +35,14 @@ class SaleCreatedEventCustomer #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * The date the customer was created. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + /** * Email of the customer. * @@ -53,14 +61,6 @@ class SaleCreatedEventCustomer #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * The date the customer was created. - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - /** * @param string $id * @param string $externalId diff --git a/src/Models/Components/SaleCreatedEventLink.php b/src/Models/Components/SaleCreatedEventLink.php index 21bce6f..205de7d 100644 --- a/src/Models/Components/SaleCreatedEventLink.php +++ b/src/Models/Components/SaleCreatedEventLink.php @@ -42,6 +42,76 @@ class SaleCreatedEventLink #[\Speakeasy\Serializer\Annotation\SerializedName('url')] public string $url; + /** + * + * @var string $expiresAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] + public string $expiresAt; + + /** + * The IDs of the webhooks that the short link is associated with. + * + * @var array $webhookIds + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $webhookIds; + + /** + * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). + * + * @var string $shortLink + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] + public string $shortLink; + + /** + * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). + * + * @var string $qrCode + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] + public string $qrCode; + + /** + * The workspace ID of the short link. + * + * @var string $workspaceId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] + public string $workspaceId; + + /** + * + * @var string $lastClicked + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] + public string $lastClicked; + + /** + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + + /** + * + * @var string $updatedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; + + /** + * The project ID of the short link. This field is deprecated – use `workspaceId` instead. + * + * @var string $projectId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] + public string $projectId; + /** * * @var ?bool $trackConversion @@ -66,13 +136,6 @@ class SaleCreatedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $archived = null; - /** - * - * @var string $expiresAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('expiresAt')] - public string $expiresAt; - /** * * @var ?string $expiredUrl @@ -195,15 +258,6 @@ class SaleCreatedEventLink #[\Speakeasy\Serializer\Annotation\Type('array<\Dub\Models\Components\TagSchema>|null')] public ?array $tags; - /** - * The IDs of the webhooks that the short link is associated with. - * - * @var array $webhookIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('webhookIds')] - #[\Speakeasy\Serializer\Annotation\Type('array')] - public array $webhookIds; - /** * The comments for the short link. * @@ -212,22 +266,6 @@ class SaleCreatedEventLink #[\Speakeasy\Serializer\Annotation\SerializedName('comments')] public ?string $comments; - /** - * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). - * - * @var string $shortLink - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('shortLink')] - public string $shortLink; - - /** - * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). - * - * @var string $qrCode - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('qrCode')] - public string $qrCode; - /** * The UTM source of the short link. * @@ -276,12 +314,12 @@ class SaleCreatedEventLink public ?string $userId; /** - * The workspace ID of the short link. + * The ID of the program the short link is associated with. * - * @var string $workspaceId + * @var ?string $programId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('workspaceId')] - public string $workspaceId; + #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] + public ?string $programId; /** * The number of clicks on the short link. @@ -292,13 +330,6 @@ class SaleCreatedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $clicks = null; - /** - * - * @var string $lastClicked - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('lastClicked')] - public string $lastClicked; - /** * [BETA]: The number of leads the short links has generated. * @@ -326,37 +357,6 @@ class SaleCreatedEventLink #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $saleAmount = null; - /** - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - - /** - * - * @var string $updatedAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] - public string $updatedAt; - - /** - * The project ID of the short link. This field is deprecated – use `workspaceId` instead. - * - * @var string $projectId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('projectId')] - public string $projectId; - - /** - * The ID of the program the short link is associated with. - * - * @var ?string $programId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('programId')] - public ?string $programId; - /** * @param string $id * @param string $domain @@ -442,10 +442,10 @@ public function __construct(string $id, string $domain, string $key, string $url $this->utmTerm = $utmTerm; $this->utmContent = $utmContent; $this->userId = $userId; + $this->programId = $programId; $this->clicks = $clicks; $this->leads = $leads; $this->sales = $sales; $this->saleAmount = $saleAmount; - $this->programId = $programId; } } \ No newline at end of file diff --git a/src/Models/Components/WorkspaceSchema.php b/src/Models/Components/WorkspaceSchema.php index a88bcca..941d028 100644 --- a/src/Models/Components/WorkspaceSchema.php +++ b/src/Models/Components/WorkspaceSchema.php @@ -35,23 +35,6 @@ class WorkspaceSchema #[\Speakeasy\Serializer\Annotation\SerializedName('slug')] public string $slug; - /** - * The logo of the workspace. - * - * @var ?string $logo - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('logo')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $logo = null; - - /** - * The invite code of the workspace. - * - * @var ?string $inviteCode - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('inviteCode')] - public ?string $inviteCode; - /** * The plan of the workspace. * @@ -61,14 +44,6 @@ class WorkspaceSchema #[\Speakeasy\Serializer\Annotation\Type('\Dub\Models\Components\Plan')] public Plan $plan; - /** - * The Stripe ID of the workspace. - * - * @var ?string $stripeId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('stripeId')] - public ?string $stripeId; - /** * The date and time when the billing cycle starts for the workspace. * @@ -77,22 +52,6 @@ class WorkspaceSchema #[\Speakeasy\Serializer\Annotation\SerializedName('billingCycleStart')] public float $billingCycleStart; - /** - * The date and time when the payment failed for the workspace. - * - * @var ?string $paymentFailedAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('paymentFailedAt')] - public ?string $paymentFailedAt; - - /** - * [BETA – Dub Conversions]: The Stripe Connect ID of the workspace. - * - * @var ?string $stripeConnectId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('stripeConnectId')] - public ?string $stripeConnectId; - /** * The usage of the workspace. * @@ -224,46 +183,63 @@ class WorkspaceSchema public array $domains; /** - * The feature flags of the workspace, indicating which features are enabled. + * The invite code of the workspace. * - * @var ?array $flags + * @var ?string $inviteCode */ - #[\Speakeasy\Serializer\Annotation\SerializedName('flags')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?array $flags = null; + #[\Speakeasy\Serializer\Annotation\SerializedName('inviteCode')] + public ?string $inviteCode; /** - * [BETA – Dub Partners]: The name of the connected bank account. + * The Stripe ID of the workspace. * - * @var ?string $bankAccountName + * @var ?string $stripeId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('bankAccountName')] - public ?string $bankAccountName; + #[\Speakeasy\Serializer\Annotation\SerializedName('stripeId')] + public ?string $stripeId; /** - * [BETA – Dub Partners]: The partial account number of the bank account. + * The date and time when the payment failed for the workspace. * - * @var ?string $partialAccountNumber + * @var ?string $paymentFailedAt */ - #[\Speakeasy\Serializer\Annotation\SerializedName('partialAccountNumber')] - public ?string $partialAccountNumber; + #[\Speakeasy\Serializer\Annotation\SerializedName('paymentFailedAt')] + public ?string $paymentFailedAt; /** - * [BETA – Dub Partners]: The routing number of the bank account. + * [BETA – Dub Conversions]: The Stripe Connect ID of the workspace. * - * @var ?string $routingNumber + * @var ?string $stripeConnectId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('routingNumber')] - public ?string $routingNumber; + #[\Speakeasy\Serializer\Annotation\SerializedName('stripeConnectId')] + public ?string $stripeConnectId; + + /** + * [BETA – Dub Partners]: The ID of the payment method for partner payouts. + * + * @var ?string $payoutMethodId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('payoutMethodId')] + public ?string $payoutMethodId; + + /** + * The feature flags of the workspace, indicating which features are enabled. + * + * @var ?array $flags + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('flags')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $flags = null; /** - * [BETA – Dub Partners]: Whether the bank account is verified. + * The logo of the workspace. * - * @var bool $bankAccountVerified + * @var ?string $logo */ - #[\Speakeasy\Serializer\Annotation\SerializedName('bankAccountVerified')] - public bool $bankAccountVerified; + #[\Speakeasy\Serializer\Annotation\SerializedName('logo')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $logo = null; /** * @param string $id @@ -287,18 +263,15 @@ class WorkspaceSchema * @param string $createdAt * @param array $users * @param array $domains - * @param bool $bankAccountVerified * @param ?string $inviteCode * @param ?string $stripeId * @param ?string $paymentFailedAt * @param ?string $stripeConnectId + * @param ?string $payoutMethodId * @param ?array $flags - * @param ?string $bankAccountName - * @param ?string $partialAccountNumber - * @param ?string $routingNumber * @param ?string $logo */ - public function __construct(string $id, string $name, string $slug, Plan $plan, float $billingCycleStart, float $usage, float $usageLimit, float $linksUsage, float $linksLimit, float $salesUsage, float $salesLimit, float $domainsLimit, float $tagsLimit, float $usersLimit, float $aiUsage, float $aiLimit, bool $conversionEnabled, bool $dotLinkClaimed, string $createdAt, array $users, array $domains, bool $bankAccountVerified, ?string $inviteCode = null, ?string $stripeId = null, ?string $paymentFailedAt = null, ?string $stripeConnectId = null, ?array $flags = null, ?string $bankAccountName = null, ?string $partialAccountNumber = null, ?string $routingNumber = null, ?string $logo = null) + public function __construct(string $id, string $name, string $slug, Plan $plan, float $billingCycleStart, float $usage, float $usageLimit, float $linksUsage, float $linksLimit, float $salesUsage, float $salesLimit, float $domainsLimit, float $tagsLimit, float $usersLimit, float $aiUsage, float $aiLimit, bool $conversionEnabled, bool $dotLinkClaimed, string $createdAt, array $users, array $domains, ?string $inviteCode = null, ?string $stripeId = null, ?string $paymentFailedAt = null, ?string $stripeConnectId = null, ?string $payoutMethodId = null, ?array $flags = null, ?string $logo = null) { $this->id = $id; $this->name = $name; @@ -321,15 +294,12 @@ public function __construct(string $id, string $name, string $slug, Plan $plan, $this->createdAt = $createdAt; $this->users = $users; $this->domains = $domains; - $this->bankAccountVerified = $bankAccountVerified; $this->inviteCode = $inviteCode; $this->stripeId = $stripeId; $this->paymentFailedAt = $paymentFailedAt; $this->stripeConnectId = $stripeConnectId; + $this->payoutMethodId = $payoutMethodId; $this->flags = $flags; - $this->bankAccountName = $bankAccountName; - $this->partialAccountNumber = $partialAccountNumber; - $this->routingNumber = $routingNumber; $this->logo = $logo; } } \ No newline at end of file diff --git a/src/Models/Operations/BulkUpdateLinksRequestBody.php b/src/Models/Operations/BulkUpdateLinksRequestBody.php index fbfce6f..da31cdd 100644 --- a/src/Models/Operations/BulkUpdateLinksRequestBody.php +++ b/src/Models/Operations/BulkUpdateLinksRequestBody.php @@ -11,6 +11,14 @@ class BulkUpdateLinksRequestBody { + /** + * + * @var Data $data + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('data')] + #[\Speakeasy\Serializer\Annotation\Type('\Dub\Models\Operations\Data')] + public Data $data; + /** * The IDs of the links to update. Takes precedence over `externalIds`. * @@ -31,14 +39,6 @@ class BulkUpdateLinksRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $externalIds = null; - /** - * - * @var Data $data - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('data')] - #[\Speakeasy\Serializer\Annotation\Type('\Dub\Models\Operations\Data')] - public Data $data; - /** * @param Data $data * @param ?array $linkIds diff --git a/src/Models/Operations/CreateCustomerRequestBody.php b/src/Models/Operations/CreateCustomerRequestBody.php index 4fcaaa7..775d08c 100644 --- a/src/Models/Operations/CreateCustomerRequestBody.php +++ b/src/Models/Operations/CreateCustomerRequestBody.php @@ -11,6 +11,14 @@ class CreateCustomerRequestBody { + /** + * Unique identifier for the customer in the client's app. + * + * @var string $externalId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] + public string $externalId; + /** * Email of the customer in the client's app. * @@ -38,14 +46,6 @@ class CreateCustomerRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * Unique identifier for the customer in the client's app. - * - * @var string $externalId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - public string $externalId; - /** * @param string $externalId * @param ?string $email diff --git a/src/Models/Operations/CreateCustomerResponseBody.php b/src/Models/Operations/CreateCustomerResponseBody.php index 23d8a31..59a4df3 100644 --- a/src/Models/Operations/CreateCustomerResponseBody.php +++ b/src/Models/Operations/CreateCustomerResponseBody.php @@ -36,6 +36,14 @@ class CreateCustomerResponseBody #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * The date the customer was created. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + /** * Email of the customer. * @@ -54,14 +62,6 @@ class CreateCustomerResponseBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * The date the customer was created. - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - /** * @param string $id * @param string $externalId diff --git a/src/Models/Operations/CreateDomainRequestBody.php b/src/Models/Operations/CreateDomainRequestBody.php index 5a7db72..024418c 100644 --- a/src/Models/Operations/CreateDomainRequestBody.php +++ b/src/Models/Operations/CreateDomainRequestBody.php @@ -37,15 +37,6 @@ class CreateDomainRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $notFoundUrl = null; - /** - * Whether to archive this domain. `false` will unarchive a previously archived domain. - * - * @var ?bool $archived - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; - /** * Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened. * @@ -64,6 +55,15 @@ class CreateDomainRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $logo = null; + /** + * Whether to archive this domain. `false` will unarchive a previously archived domain. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; + /** * @param string $slug * @param ?bool $archived @@ -75,10 +75,10 @@ class CreateDomainRequestBody public function __construct(string $slug, ?string $expiredUrl = null, ?string $notFoundUrl = null, ?string $placeholder = null, ?string $logo = null, ?bool $archived = false) { $this->slug = $slug; - $this->archived = $archived; $this->expiredUrl = $expiredUrl; $this->notFoundUrl = $notFoundUrl; $this->placeholder = $placeholder; $this->logo = $logo; + $this->archived = $archived; } } \ No newline at end of file diff --git a/src/Models/Operations/CreateLinkRequestBody.php b/src/Models/Operations/CreateLinkRequestBody.php index 5852ce0..f53e74f 100644 --- a/src/Models/Operations/CreateLinkRequestBody.php +++ b/src/Models/Operations/CreateLinkRequestBody.php @@ -37,15 +37,6 @@ class CreateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $key = null; - /** - * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. - * - * @var ?string $externalId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $externalId = null; - /** * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. * @@ -56,32 +47,33 @@ class CreateLinkRequestBody public ?string $prefix = null; /** - * Whether to track conversions for the short link. + * The unique IDs of the tags assigned to the short link. * - * @var ?bool $trackConversion + * @var string|array|null $tagIds */ - #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $trackConversion = null; + public string|array|null $tagIds = null; /** - * Whether the short link is archived. + * The unique name of the tags assigned to the short link (case insensitive). * - * @var ?bool $archived + * @var string|array|null $tagNames */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; + public string|array|null $tagNames = null; /** - * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. * - * @var ?bool $publicStats - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * @var ?string $externalId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $publicStats = null; + public ?string $externalId = null; /** * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. @@ -93,26 +85,6 @@ class CreateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $tagId = null; - /** - * The unique IDs of the tags assigned to the short link. - * - * @var string|array|null $tagIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagIds = null; - - /** - * The unique name of the tags assigned to the short link (case insensitive). - * - * @var string|array|null $tagNames - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagNames = null; - /** * The comments for the short link. * @@ -149,15 +121,6 @@ class CreateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $password = null; - /** - * Whether the short link uses Custom Social Media Cards feature. - * - * @var ?bool $proxy - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $proxy = null; - /** * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og * @@ -194,15 +157,6 @@ class CreateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $video = null; - /** - * Whether the short link uses link cloaking. - * - * @var ?bool $rewrite - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $rewrite = null; - /** * The iOS destination URL for the short link for iOS device targeting. * @@ -231,15 +185,6 @@ class CreateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Components\LinkGeoTargeting $geo = null; - /** - * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex - * - * @var ?bool $doIndex - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $doIndex = null; - /** * The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL. * @@ -313,6 +258,61 @@ class CreateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $webhookIds = null; + /** + * Whether to track conversions for the short link. + * + * @var ?bool $trackConversion + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $trackConversion = null; + + /** + * Whether the short link is archived. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; + + /** + * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * + * @var ?bool $publicStats + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $publicStats = null; + + /** + * Whether the short link uses Custom Social Media Cards feature. + * + * @var ?bool $proxy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $proxy = null; + + /** + * Whether the short link uses link cloaking. + * + * @var ?bool $rewrite + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $rewrite = null; + + /** + * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex + * + * @var ?bool $doIndex + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $doIndex = null; + /** * @param string $url * @param ?string $domain @@ -354,14 +354,8 @@ public function __construct(string $url, ?string $domain = null, ?string $key = $this->domain = $domain; $this->key = $key; $this->prefix = $prefix; - $this->trackConversion = $trackConversion; - $this->archived = $archived; - $this->publicStats = $publicStats; $this->tagIds = $tagIds; $this->tagNames = $tagNames; - $this->proxy = $proxy; - $this->rewrite = $rewrite; - $this->doIndex = $doIndex; $this->externalId = $externalId; $this->tagId = $tagId; $this->comments = $comments; @@ -383,5 +377,11 @@ public function __construct(string $url, ?string $domain = null, ?string $key = $this->ref = $ref; $this->programId = $programId; $this->webhookIds = $webhookIds; + $this->trackConversion = $trackConversion; + $this->archived = $archived; + $this->publicStats = $publicStats; + $this->proxy = $proxy; + $this->rewrite = $rewrite; + $this->doIndex = $doIndex; } } \ No newline at end of file diff --git a/src/Models/Operations/Data.php b/src/Models/Operations/Data.php index fb411fd..b8a4b9d 100644 --- a/src/Models/Operations/Data.php +++ b/src/Models/Operations/Data.php @@ -20,44 +20,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $url = null; - /** - * Whether to track conversions for the short link. - * - * @var ?bool $trackConversion - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $trackConversion = null; - - /** - * Whether the short link is archived. - * - * @var ?bool $archived - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; - - /** - * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. - * - * @var ?bool $publicStats - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $publicStats = null; - - /** - * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. - * - * @var ?string $tagId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $tagId = null; - /** * The unique IDs of the tags assigned to the short link. * @@ -78,6 +40,16 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public string|array|null $tagNames = null; + /** + * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. + * + * @var ?string $tagId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('tagId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $tagId = null; + /** * The comments for the short link. * @@ -114,15 +86,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $password = null; - /** - * Whether the short link uses Custom Social Media Cards feature. - * - * @var ?bool $proxy - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $proxy = null; - /** * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og * @@ -159,15 +122,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $video = null; - /** - * Whether the short link uses link cloaking. - * - * @var ?bool $rewrite - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $rewrite = null; - /** * The iOS destination URL for the short link for iOS device targeting. * @@ -196,15 +150,6 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Components\LinkGeoTargeting $geo = null; - /** - * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex - * - * @var ?bool $doIndex - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $doIndex = null; - /** * The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL. * @@ -278,6 +223,61 @@ class Data #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $webhookIds = null; + /** + * Whether to track conversions for the short link. + * + * @var ?bool $trackConversion + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $trackConversion = null; + + /** + * Whether the short link is archived. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; + + /** + * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * + * @var ?bool $publicStats + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $publicStats = null; + + /** + * Whether the short link uses Custom Social Media Cards feature. + * + * @var ?bool $proxy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $proxy = null; + + /** + * Whether the short link uses link cloaking. + * + * @var ?bool $rewrite + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $rewrite = null; + + /** + * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex + * + * @var ?bool $doIndex + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $doIndex = null; + /** * @param ?string $url * @param ?bool $trackConversion @@ -312,14 +312,8 @@ class Data public function __construct(?string $url = null, string|array|null $tagIds = null, string|array|null $tagNames = null, ?string $tagId = null, ?string $comments = null, ?string $expiresAt = null, ?string $expiredUrl = null, ?string $password = null, ?string $title = null, ?string $description = null, ?string $image = null, ?string $video = null, ?string $ios = null, ?string $android = null, ?Components\LinkGeoTargeting $geo = null, ?string $utmSource = null, ?string $utmMedium = null, ?string $utmCampaign = null, ?string $utmTerm = null, ?string $utmContent = null, ?string $ref = null, ?string $programId = null, ?array $webhookIds = null, ?bool $trackConversion = false, ?bool $archived = false, ?bool $publicStats = false, ?bool $proxy = false, ?bool $rewrite = false, ?bool $doIndex = false) { $this->url = $url; - $this->trackConversion = $trackConversion; - $this->archived = $archived; - $this->publicStats = $publicStats; $this->tagIds = $tagIds; $this->tagNames = $tagNames; - $this->proxy = $proxy; - $this->rewrite = $rewrite; - $this->doIndex = $doIndex; $this->tagId = $tagId; $this->comments = $comments; $this->expiresAt = $expiresAt; @@ -340,5 +334,11 @@ public function __construct(?string $url = null, string|array|null $tagIds = nul $this->ref = $ref; $this->programId = $programId; $this->webhookIds = $webhookIds; + $this->trackConversion = $trackConversion; + $this->archived = $archived; + $this->publicStats = $publicStats; + $this->proxy = $proxy; + $this->rewrite = $rewrite; + $this->doIndex = $doIndex; } } \ No newline at end of file diff --git a/src/Models/Operations/GetCustomerResponseBody.php b/src/Models/Operations/GetCustomerResponseBody.php index 5a9b098..9bb6717 100644 --- a/src/Models/Operations/GetCustomerResponseBody.php +++ b/src/Models/Operations/GetCustomerResponseBody.php @@ -36,6 +36,14 @@ class GetCustomerResponseBody #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * The date the customer was created. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + /** * Email of the customer. * @@ -54,14 +62,6 @@ class GetCustomerResponseBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * The date the customer was created. - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - /** * @param string $id * @param string $externalId diff --git a/src/Models/Operations/GetLinksCountRequest.php b/src/Models/Operations/GetLinksCountRequest.php index 5a5b969..29a6ea5 100644 --- a/src/Models/Operations/GetLinksCountRequest.php +++ b/src/Models/Operations/GetLinksCountRequest.php @@ -59,6 +59,14 @@ class GetLinksCountRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=userId')] public ?string $userId = null; + /** + * The field to group the links by. + * + * @var One|Two|Three|null $groupBy + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=groupBy')] + public One|Two|Three|null $groupBy = null; + /** * Whether to include archived links in the response. Defaults to `false` if not provided. * @@ -75,14 +83,6 @@ class GetLinksCountRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=withTags')] public ?bool $withTags = null; - /** - * The field to group the links by. - * - * @var One|Two|Three|null $groupBy - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=groupBy')] - public One|Two|Three|null $groupBy = null; - /** * @param ?string $domain * @param ?string $tagId @@ -102,8 +102,8 @@ public function __construct(?string $domain = null, ?string $tagId = null, strin $this->tagNames = $tagNames; $this->search = $search; $this->userId = $userId; + $this->groupBy = $groupBy; $this->showArchived = $showArchived; $this->withTags = $withTags; - $this->groupBy = $groupBy; } } \ No newline at end of file diff --git a/src/Models/Operations/ListDomainsRequest.php b/src/Models/Operations/ListDomainsRequest.php index fb69526..49ad686 100644 --- a/src/Models/Operations/ListDomainsRequest.php +++ b/src/Models/Operations/ListDomainsRequest.php @@ -11,14 +11,6 @@ use Dub\Utils\SpeakeasyMetadata; class ListDomainsRequest { - /** - * Whether to include archived domains in the response. Defaults to `false` if not provided. - * - * @var ?bool $archived - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=archived')] - public ?bool $archived = null; - /** * The search term to filter the domains by. * @@ -27,6 +19,14 @@ class ListDomainsRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=search')] public ?string $search = null; + /** + * Whether to include archived domains in the response. Defaults to `false` if not provided. + * + * @var ?bool $archived + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=archived')] + public ?bool $archived = null; + /** * The page number for pagination. * @@ -51,8 +51,8 @@ class ListDomainsRequest */ public function __construct(?string $search = null, ?bool $archived = true, ?float $page = 1, ?float $pageSize = 50) { - $this->archived = $archived; $this->search = $search; + $this->archived = $archived; $this->page = $page; $this->pageSize = $pageSize; } diff --git a/src/Models/Operations/ListEventsRequest.php b/src/Models/Operations/ListEventsRequest.php index 968bab6..eef51a6 100644 --- a/src/Models/Operations/ListEventsRequest.php +++ b/src/Models/Operations/ListEventsRequest.php @@ -12,14 +12,6 @@ use Dub\Utils\SpeakeasyMetadata; class ListEventsRequest { - /** - * The type of event to retrieve analytics for. Defaults to 'clicks'. - * - * @var ?QueryParamEvent $event - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=event')] - public ?QueryParamEvent $event = null; - /** * The domain to filter analytics for. * @@ -52,14 +44,6 @@ class ListEventsRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=externalId')] public ?string $externalId = null; - /** - * The interval to retrieve events for. Takes precedence over start and end. If undefined, defaults to 24h. - * - * @var ?QueryParamInterval $interval - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=interval')] - public ?QueryParamInterval $interval = null; - /** * The start date and time when to retrieve analytics from. Takes precedence over `interval`. * @@ -76,14 +60,6 @@ class ListEventsRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=end')] public ?string $end = null; - /** - * The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC. - * - * @var ?string $timezone - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=timezone')] - public ?string $timezone = null; - /** * The country to retrieve analytics for. * @@ -204,6 +180,30 @@ class ListEventsRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=root')] public ?bool $root = null; + /** + * The type of event to retrieve analytics for. Defaults to 'clicks'. + * + * @var ?QueryParamEvent $event + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=event')] + public ?QueryParamEvent $event = null; + + /** + * The interval to retrieve events for. Takes precedence over start and end. If undefined, defaults to 24h. + * + * @var ?QueryParamInterval $interval + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=interval')] + public ?QueryParamInterval $interval = null; + + /** + * The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC. + * + * @var ?string $timezone + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=timezone')] + public ?string $timezone = null; + /** * * @var ?float $page @@ -264,15 +264,12 @@ class ListEventsRequest */ public function __construct(?string $domain = null, ?string $key = null, ?string $linkId = null, ?string $externalId = null, ?string $start = null, ?string $end = null, ?Components\CountryCode $country = null, ?string $city = null, ?string $region = null, ?Components\ContinentCode $continent = null, ?string $device = null, ?string $browser = null, ?string $os = null, ?QueryParamTrigger $trigger = null, ?string $referer = null, ?string $refererUrl = null, ?string $url = null, ?string $tagId = null, string|array|null $tagIds = null, ?bool $qr = null, ?bool $root = null, ?QueryParamEvent $event = QueryParamEvent::Clicks, ?QueryParamInterval $interval = QueryParamInterval::TwentyFourh, ?string $timezone = 'UTC', ?float $page = 1, ?float $limit = 100, ?Order $order = Order::Desc, ?SortBy $sortBy = SortBy::Timestamp) { - $this->event = $event; $this->domain = $domain; $this->key = $key; $this->linkId = $linkId; $this->externalId = $externalId; - $this->interval = $interval; $this->start = $start; $this->end = $end; - $this->timezone = $timezone; $this->country = $country; $this->city = $city; $this->region = $region; @@ -288,6 +285,9 @@ public function __construct(?string $domain = null, ?string $key = null, ?string $this->tagIds = $tagIds; $this->qr = $qr; $this->root = $root; + $this->event = $event; + $this->interval = $interval; + $this->timezone = $timezone; $this->page = $page; $this->limit = $limit; $this->order = $order; diff --git a/src/Models/Operations/RequestBody.php b/src/Models/Operations/RequestBody.php index 4c5a859..a00b156 100644 --- a/src/Models/Operations/RequestBody.php +++ b/src/Models/Operations/RequestBody.php @@ -37,15 +37,6 @@ class RequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $key = null; - /** - * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. - * - * @var ?string $externalId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $externalId = null; - /** * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. * @@ -56,32 +47,33 @@ class RequestBody public ?string $prefix = null; /** - * Whether to track conversions for the short link. + * The unique IDs of the tags assigned to the short link. * - * @var ?bool $trackConversion + * @var string|array|null $tagIds */ - #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $trackConversion = null; + public string|array|null $tagIds = null; /** - * Whether the short link is archived. + * The unique name of the tags assigned to the short link (case insensitive). * - * @var ?bool $archived + * @var string|array|null $tagNames */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; + public string|array|null $tagNames = null; /** - * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. * - * @var ?bool $publicStats - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * @var ?string $externalId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $publicStats = null; + public ?string $externalId = null; /** * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. @@ -93,26 +85,6 @@ class RequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $tagId = null; - /** - * The unique IDs of the tags assigned to the short link. - * - * @var string|array|null $tagIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagIds = null; - - /** - * The unique name of the tags assigned to the short link (case insensitive). - * - * @var string|array|null $tagNames - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagNames = null; - /** * The comments for the short link. * @@ -149,15 +121,6 @@ class RequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $password = null; - /** - * Whether the short link uses Custom Social Media Cards feature. - * - * @var ?bool $proxy - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $proxy = null; - /** * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og * @@ -194,15 +157,6 @@ class RequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $video = null; - /** - * Whether the short link uses link cloaking. - * - * @var ?bool $rewrite - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $rewrite = null; - /** * The iOS destination URL for the short link for iOS device targeting. * @@ -231,15 +185,6 @@ class RequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Components\LinkGeoTargeting $geo = null; - /** - * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex - * - * @var ?bool $doIndex - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $doIndex = null; - /** * The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL. * @@ -313,6 +258,61 @@ class RequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $webhookIds = null; + /** + * Whether to track conversions for the short link. + * + * @var ?bool $trackConversion + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $trackConversion = null; + + /** + * Whether the short link is archived. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; + + /** + * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * + * @var ?bool $publicStats + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $publicStats = null; + + /** + * Whether the short link uses Custom Social Media Cards feature. + * + * @var ?bool $proxy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $proxy = null; + + /** + * Whether the short link uses link cloaking. + * + * @var ?bool $rewrite + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $rewrite = null; + + /** + * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex + * + * @var ?bool $doIndex + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $doIndex = null; + /** * @param string $url * @param ?string $domain @@ -354,14 +354,8 @@ public function __construct(string $url, ?string $domain = null, ?string $key = $this->domain = $domain; $this->key = $key; $this->prefix = $prefix; - $this->trackConversion = $trackConversion; - $this->archived = $archived; - $this->publicStats = $publicStats; $this->tagIds = $tagIds; $this->tagNames = $tagNames; - $this->proxy = $proxy; - $this->rewrite = $rewrite; - $this->doIndex = $doIndex; $this->externalId = $externalId; $this->tagId = $tagId; $this->comments = $comments; @@ -383,5 +377,11 @@ public function __construct(string $url, ?string $domain = null, ?string $key = $this->ref = $ref; $this->programId = $programId; $this->webhookIds = $webhookIds; + $this->trackConversion = $trackConversion; + $this->archived = $archived; + $this->publicStats = $publicStats; + $this->proxy = $proxy; + $this->rewrite = $rewrite; + $this->doIndex = $doIndex; } } \ No newline at end of file diff --git a/src/Models/Operations/ResponseBody.php b/src/Models/Operations/ResponseBody.php index dc9c260..127c8aa 100644 --- a/src/Models/Operations/ResponseBody.php +++ b/src/Models/Operations/ResponseBody.php @@ -35,6 +35,14 @@ class ResponseBody #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * The date the customer was created. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + /** * Email of the customer. * @@ -53,14 +61,6 @@ class ResponseBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * The date the customer was created. - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - /** * @param string $id * @param string $externalId diff --git a/src/Models/Operations/RetrieveAnalyticsRequest.php b/src/Models/Operations/RetrieveAnalyticsRequest.php index 38971bd..dfee611 100644 --- a/src/Models/Operations/RetrieveAnalyticsRequest.php +++ b/src/Models/Operations/RetrieveAnalyticsRequest.php @@ -12,22 +12,6 @@ use Dub\Utils\SpeakeasyMetadata; class RetrieveAnalyticsRequest { - /** - * The type of event to retrieve analytics for. Defaults to `clicks`. - * - * @var ?Event $event - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=event')] - public ?Event $event = null; - - /** - * The parameter to group the analytics data points by. Defaults to `count` if undefined. Note that `trigger` is deprecated (use `triggers` instead), but kept for backwards compatibility. - * - * @var ?QueryParamGroupBy $groupBy - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=groupBy')] - public ?QueryParamGroupBy $groupBy = null; - /** * The domain to filter analytics for. * @@ -84,14 +68,6 @@ class RetrieveAnalyticsRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=end')] public ?string $end = null; - /** - * The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC. - * - * @var ?string $timezone - */ - #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=timezone')] - public ?string $timezone = null; - /** * The country to retrieve analytics for. * @@ -212,6 +188,30 @@ class RetrieveAnalyticsRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=root')] public ?bool $root = null; + /** + * The type of event to retrieve analytics for. Defaults to `clicks`. + * + * @var ?Event $event + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=event')] + public ?Event $event = null; + + /** + * The parameter to group the analytics data points by. Defaults to `count` if undefined. Note that `trigger` is deprecated (use `triggers` instead), but kept for backwards compatibility. + * + * @var ?QueryParamGroupBy $groupBy + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=groupBy')] + public ?QueryParamGroupBy $groupBy = null; + + /** + * The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC. + * + * @var ?string $timezone + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=timezone')] + public ?string $timezone = null; + /** * @param ?Event $event * @param ?QueryParamGroupBy $groupBy @@ -241,8 +241,6 @@ class RetrieveAnalyticsRequest */ public function __construct(?string $domain = null, ?string $key = null, ?string $linkId = null, ?string $externalId = null, ?Interval $interval = null, ?string $start = null, ?string $end = null, ?Components\CountryCode $country = null, ?string $city = null, ?string $region = null, ?Components\ContinentCode $continent = null, ?string $device = null, ?string $browser = null, ?string $os = null, ?Trigger $trigger = null, ?string $referer = null, ?string $refererUrl = null, ?string $url = null, ?string $tagId = null, string|array|null $tagIds = null, ?bool $qr = null, ?bool $root = null, ?Event $event = Event::Clicks, ?QueryParamGroupBy $groupBy = QueryParamGroupBy::Count, ?string $timezone = 'UTC') { - $this->event = $event; - $this->groupBy = $groupBy; $this->domain = $domain; $this->key = $key; $this->linkId = $linkId; @@ -250,7 +248,6 @@ public function __construct(?string $domain = null, ?string $key = null, ?string $this->interval = $interval; $this->start = $start; $this->end = $end; - $this->timezone = $timezone; $this->country = $country; $this->city = $city; $this->region = $region; @@ -266,5 +263,8 @@ public function __construct(?string $domain = null, ?string $key = null, ?string $this->tagIds = $tagIds; $this->qr = $qr; $this->root = $root; + $this->event = $event; + $this->groupBy = $groupBy; + $this->timezone = $timezone; } } \ No newline at end of file diff --git a/src/Models/Operations/TrackLeadRequestBody.php b/src/Models/Operations/TrackLeadRequestBody.php index 2bb1e46..6a093bb 100644 --- a/src/Models/Operations/TrackLeadRequestBody.php +++ b/src/Models/Operations/TrackLeadRequestBody.php @@ -27,6 +27,16 @@ class TrackLeadRequestBody #[\Speakeasy\Serializer\Annotation\SerializedName('eventName')] public string $eventName; + /** + * Additional metadata to be stored with the lead event + * + * @var ?array $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + /** * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey. * @@ -73,16 +83,6 @@ class TrackLeadRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $customerAvatar = null; - /** - * Additional metadata to be stored with the lead event - * - * @var ?array $metadata - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?array $metadata = null; - /** * @param string $clickId * @param string $eventName @@ -97,11 +97,11 @@ public function __construct(string $clickId, string $eventName, ?array $metadata { $this->clickId = $clickId; $this->eventName = $eventName; + $this->metadata = $metadata; $this->externalId = $externalId; $this->customerId = $customerId; $this->customerName = $customerName; $this->customerEmail = $customerEmail; $this->customerAvatar = $customerAvatar; - $this->metadata = $metadata; } } \ No newline at end of file diff --git a/src/Models/Operations/TrackSaleRequestBody.php b/src/Models/Operations/TrackSaleRequestBody.php index 88838e6..1a7cadb 100644 --- a/src/Models/Operations/TrackSaleRequestBody.php +++ b/src/Models/Operations/TrackSaleRequestBody.php @@ -11,25 +11,6 @@ class TrackSaleRequestBody { - /** - * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey. - * - * @var ?string $externalId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $externalId = null; - - /** - * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey. - * - * @var ?string $customerId - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('customerId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $customerId = null; - /** * The amount of the sale. Should be passed in cents. * @@ -48,22 +29,32 @@ class TrackSaleRequestBody public PaymentProcessor $paymentProcessor; /** - * The name of the sale event. It can be used to track different types of event for example 'Purchase', 'Upgrade', 'Payment', etc. + * Additional metadata to be stored with the sale event. * - * @var ?string $eventName + * @var ?array $metadata */ - #[\Speakeasy\Serializer\Annotation\SerializedName('eventName')] + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $eventName = null; + public ?array $metadata = null; /** - * The invoice ID of the sale. + * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey. * - * @var ?string $invoiceId + * @var ?string $externalId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('invoiceId')] + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $invoiceId = null; + public ?string $externalId = null; + + /** + * The name of the sale event. It can be used to track different types of event for example 'Purchase', 'Upgrade', 'Payment', etc. + * + * @var ?string $eventName + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('eventName')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $eventName = null; /** * The currency of the sale. Accepts ISO 4217 currency codes. @@ -75,14 +66,23 @@ class TrackSaleRequestBody public ?string $currency = null; /** - * Additional metadata to be stored with the sale event. + * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey. * - * @var ?array $metadata + * @var ?string $customerId + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ - #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SerializedName('customerId')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?array $metadata = null; + public ?string $customerId = null; + + /** + * The invoice ID of the sale. + * + * @var ?string $invoiceId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('invoiceId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $invoiceId = null; /** * @param int $amount @@ -98,11 +98,11 @@ public function __construct(int $amount, PaymentProcessor $paymentProcessor, ?ar { $this->amount = $amount; $this->paymentProcessor = $paymentProcessor; + $this->metadata = $metadata; $this->externalId = $externalId; $this->eventName = $eventName; $this->currency = $currency; $this->customerId = $customerId; $this->invoiceId = $invoiceId; - $this->metadata = $metadata; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateCustomerRequestBody.php b/src/Models/Operations/UpdateCustomerRequestBody.php index 16de895..a7cc4e6 100644 --- a/src/Models/Operations/UpdateCustomerRequestBody.php +++ b/src/Models/Operations/UpdateCustomerRequestBody.php @@ -11,6 +11,15 @@ class UpdateCustomerRequestBody { + /** + * Unique identifier for the customer in the client's app. + * + * @var ?string $externalId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $externalId = null; + /** * Email of the customer in the client's app. * @@ -38,15 +47,6 @@ class UpdateCustomerRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * Unique identifier for the customer in the client's app. - * - * @var ?string $externalId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $externalId = null; - /** * @param ?string $externalId * @param ?string $email diff --git a/src/Models/Operations/UpdateCustomerResponseBody.php b/src/Models/Operations/UpdateCustomerResponseBody.php index 1724d7f..1bc705a 100644 --- a/src/Models/Operations/UpdateCustomerResponseBody.php +++ b/src/Models/Operations/UpdateCustomerResponseBody.php @@ -36,6 +36,14 @@ class UpdateCustomerResponseBody #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * The date the customer was created. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + /** * Email of the customer. * @@ -54,14 +62,6 @@ class UpdateCustomerResponseBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $avatar = null; - /** - * The date the customer was created. - * - * @var string $createdAt - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] - public string $createdAt; - /** * @param string $id * @param string $externalId diff --git a/src/Models/Operations/UpdateDomainRequestBody.php b/src/Models/Operations/UpdateDomainRequestBody.php index 52d57ac..d9bda27 100644 --- a/src/Models/Operations/UpdateDomainRequestBody.php +++ b/src/Models/Operations/UpdateDomainRequestBody.php @@ -38,15 +38,6 @@ class UpdateDomainRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $notFoundUrl = null; - /** - * Whether to archive this domain. `false` will unarchive a previously archived domain. - * - * @var ?bool $archived - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; - /** * Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened. * @@ -65,6 +56,15 @@ class UpdateDomainRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $logo = null; + /** + * Whether to archive this domain. `false` will unarchive a previously archived domain. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; + /** * @param ?string $slug * @param ?bool $archived @@ -76,10 +76,10 @@ class UpdateDomainRequestBody public function __construct(?string $slug = null, ?string $expiredUrl = null, ?string $notFoundUrl = null, ?string $placeholder = null, ?string $logo = null, ?bool $archived = false) { $this->slug = $slug; - $this->archived = $archived; $this->expiredUrl = $expiredUrl; $this->notFoundUrl = $notFoundUrl; $this->placeholder = $placeholder; $this->logo = $logo; + $this->archived = $archived; } } \ No newline at end of file diff --git a/src/Models/Operations/UpdateLinkRequestBody.php b/src/Models/Operations/UpdateLinkRequestBody.php index 4eee1b6..7cafb03 100644 --- a/src/Models/Operations/UpdateLinkRequestBody.php +++ b/src/Models/Operations/UpdateLinkRequestBody.php @@ -38,15 +38,6 @@ class UpdateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $key = null; - /** - * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. - * - * @var ?string $externalId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $externalId = null; - /** * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. * @@ -57,32 +48,33 @@ class UpdateLinkRequestBody public ?string $prefix = null; /** - * Whether to track conversions for the short link. + * The unique IDs of the tags assigned to the short link. * - * @var ?bool $trackConversion + * @var string|array|null $tagIds */ - #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $trackConversion = null; + public string|array|null $tagIds = null; /** - * Whether the short link is archived. + * The unique name of the tags assigned to the short link (case insensitive). * - * @var ?bool $archived + * @var string|array|null $tagNames */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; + public string|array|null $tagNames = null; /** - * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. * - * @var ?bool $publicStats - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * @var ?string $externalId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $publicStats = null; + public ?string $externalId = null; /** * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. @@ -94,26 +86,6 @@ class UpdateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $tagId = null; - /** - * The unique IDs of the tags assigned to the short link. - * - * @var string|array|null $tagIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagIds = null; - - /** - * The unique name of the tags assigned to the short link (case insensitive). - * - * @var string|array|null $tagNames - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagNames = null; - /** * The comments for the short link. * @@ -150,15 +122,6 @@ class UpdateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $password = null; - /** - * Whether the short link uses Custom Social Media Cards feature. - * - * @var ?bool $proxy - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $proxy = null; - /** * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og * @@ -195,15 +158,6 @@ class UpdateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $video = null; - /** - * Whether the short link uses link cloaking. - * - * @var ?bool $rewrite - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $rewrite = null; - /** * The iOS destination URL for the short link for iOS device targeting. * @@ -232,15 +186,6 @@ class UpdateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Components\LinkGeoTargeting $geo = null; - /** - * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex - * - * @var ?bool $doIndex - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $doIndex = null; - /** * The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL. * @@ -314,6 +259,61 @@ class UpdateLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $webhookIds = null; + /** + * Whether to track conversions for the short link. + * + * @var ?bool $trackConversion + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $trackConversion = null; + + /** + * Whether the short link is archived. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; + + /** + * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * + * @var ?bool $publicStats + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $publicStats = null; + + /** + * Whether the short link uses Custom Social Media Cards feature. + * + * @var ?bool $proxy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $proxy = null; + + /** + * Whether the short link uses link cloaking. + * + * @var ?bool $rewrite + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $rewrite = null; + + /** + * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex + * + * @var ?bool $doIndex + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $doIndex = null; + /** * @param ?string $url * @param ?string $domain @@ -355,14 +355,8 @@ public function __construct(?string $url = null, ?string $domain = null, ?string $this->domain = $domain; $this->key = $key; $this->prefix = $prefix; - $this->trackConversion = $trackConversion; - $this->archived = $archived; - $this->publicStats = $publicStats; $this->tagIds = $tagIds; $this->tagNames = $tagNames; - $this->proxy = $proxy; - $this->rewrite = $rewrite; - $this->doIndex = $doIndex; $this->externalId = $externalId; $this->tagId = $tagId; $this->comments = $comments; @@ -384,5 +378,11 @@ public function __construct(?string $url = null, ?string $domain = null, ?string $this->ref = $ref; $this->programId = $programId; $this->webhookIds = $webhookIds; + $this->trackConversion = $trackConversion; + $this->archived = $archived; + $this->publicStats = $publicStats; + $this->proxy = $proxy; + $this->rewrite = $rewrite; + $this->doIndex = $doIndex; } } \ No newline at end of file diff --git a/src/Models/Operations/UpsertLinkRequestBody.php b/src/Models/Operations/UpsertLinkRequestBody.php index 5b170ab..2ef4554 100644 --- a/src/Models/Operations/UpsertLinkRequestBody.php +++ b/src/Models/Operations/UpsertLinkRequestBody.php @@ -37,15 +37,6 @@ class UpsertLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $key = null; - /** - * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. - * - * @var ?string $externalId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $externalId = null; - /** * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. * @@ -56,32 +47,33 @@ class UpsertLinkRequestBody public ?string $prefix = null; /** - * Whether to track conversions for the short link. + * The unique IDs of the tags assigned to the short link. * - * @var ?bool $trackConversion + * @var string|array|null $tagIds */ - #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $trackConversion = null; + public string|array|null $tagIds = null; /** - * Whether the short link is archived. + * The unique name of the tags assigned to the short link (case insensitive). * - * @var ?bool $archived + * @var string|array|null $tagNames */ - #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] + #[\Speakeasy\Serializer\Annotation\Type('string|array')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $archived = null; + public string|array|null $tagNames = null; /** - * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * This is the ID of the link in your database. If set, it can be used to identify the link in the future. Must be prefixed with `ext_` when passed as a query parameter. * - * @var ?bool $publicStats - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * @var ?string $externalId */ - #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SerializedName('externalId')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $publicStats = null; + public ?string $externalId = null; /** * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. @@ -93,26 +85,6 @@ class UpsertLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $tagId = null; - /** - * The unique IDs of the tags assigned to the short link. - * - * @var string|array|null $tagIds - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagIds')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagIds = null; - - /** - * The unique name of the tags assigned to the short link (case insensitive). - * - * @var string|array|null $tagNames - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('tagNames')] - #[\Speakeasy\Serializer\Annotation\Type('string|array')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public string|array|null $tagNames = null; - /** * The comments for the short link. * @@ -149,15 +121,6 @@ class UpsertLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $password = null; - /** - * Whether the short link uses Custom Social Media Cards feature. - * - * @var ?bool $proxy - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $proxy = null; - /** * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og * @@ -194,15 +157,6 @@ class UpsertLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $video = null; - /** - * Whether the short link uses link cloaking. - * - * @var ?bool $rewrite - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $rewrite = null; - /** * The iOS destination URL for the short link for iOS device targeting. * @@ -231,15 +185,6 @@ class UpsertLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?Components\LinkGeoTargeting $geo = null; - /** - * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex - * - * @var ?bool $doIndex - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] - #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $doIndex = null; - /** * The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL. * @@ -313,6 +258,61 @@ class UpsertLinkRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $webhookIds = null; + /** + * Whether to track conversions for the short link. + * + * @var ?bool $trackConversion + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('trackConversion')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $trackConversion = null; + + /** + * Whether the short link is archived. + * + * @var ?bool $archived + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $archived = null; + + /** + * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. + * + * @var ?bool $publicStats + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('publicStats')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $publicStats = null; + + /** + * Whether the short link uses Custom Social Media Cards feature. + * + * @var ?bool $proxy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('proxy')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $proxy = null; + + /** + * Whether the short link uses link cloaking. + * + * @var ?bool $rewrite + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('rewrite')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $rewrite = null; + + /** + * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex + * + * @var ?bool $doIndex + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('doIndex')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $doIndex = null; + /** * @param string $url * @param ?string $domain @@ -354,14 +354,8 @@ public function __construct(string $url, ?string $domain = null, ?string $key = $this->domain = $domain; $this->key = $key; $this->prefix = $prefix; - $this->trackConversion = $trackConversion; - $this->archived = $archived; - $this->publicStats = $publicStats; $this->tagIds = $tagIds; $this->tagNames = $tagNames; - $this->proxy = $proxy; - $this->rewrite = $rewrite; - $this->doIndex = $doIndex; $this->externalId = $externalId; $this->tagId = $tagId; $this->comments = $comments; @@ -383,5 +377,11 @@ public function __construct(string $url, ?string $domain = null, ?string $key = $this->ref = $ref; $this->programId = $programId; $this->webhookIds = $webhookIds; + $this->trackConversion = $trackConversion; + $this->archived = $archived; + $this->publicStats = $publicStats; + $this->proxy = $proxy; + $this->rewrite = $rewrite; + $this->doIndex = $doIndex; } } \ No newline at end of file diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 8e646be..103f806 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -26,11 +26,11 @@ class SDKConfiguration public string $openapiDocVersion = '0.0.1'; - public string $sdkVersion = '0.11.7'; + public string $sdkVersion = '0.11.8'; - public string $genVersion = '2.474.15'; + public string $genVersion = '2.481.0'; - public string $userAgent = 'speakeasy-sdk/php 0.11.7 2.474.15 0.0.1 dub/dub-php'; + public string $userAgent = 'speakeasy-sdk/php 0.11.8 2.481.0 0.0.1 dub/dub-php'; public function __construct() { diff --git a/src/Tags.php b/src/Tags.php index 1ffac20..f095ba3 100644 --- a/src/Tags.php +++ b/src/Tags.php @@ -210,23 +210,27 @@ public function create(?Operations\CreateTagRequestBody $request = null): Operat } /** - * Retrieve a list of tags + * Delete a tag * - * Retrieve a list of tags for the authenticated workspace. + * Delete a tag from the workspace. All existing links will still work, but they will no longer be associated with this tag. * - * @return Operations\GetTagsResponse + * @param string $id + * @return Operations\DeleteTagResponse * @throws \Dub\Models\Errors\SDKException */ - public function list(): Operations\GetTagsResponse + public function delete(string $id): Operations\DeleteTagResponse { + $request = new Operations\DeleteTagRequest( + id: $id, + ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/tags'); + $url = Utils\Utils::generateUrl($baseUrl, '/tags/{id}', Operations\DeleteTagRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); - $hookContext = new HookContext('getTags', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('deleteTag', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -253,12 +257,12 @@ public function list(): Operations\GetTagsResponse $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\TagSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\GetTagsResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteTagResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\DeleteTagResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - tagSchemas: $obj); + object: $obj); return $response; } else { @@ -371,33 +375,23 @@ public function list(): Operations\GetTagsResponse } /** - * Update a tag + * Retrieve a list of tags * - * Update a tag in the workspace. + * Retrieve a list of tags for the authenticated workspace. * - * @param string $id - * @param ?Operations\UpdateTagRequestBody $requestBody - * @return Operations\UpdateTagResponse + * @return Operations\GetTagsResponse * @throws \Dub\Models\Errors\SDKException */ - public function update(string $id, ?Operations\UpdateTagRequestBody $requestBody = null): Operations\UpdateTagResponse + public function list(): Operations\GetTagsResponse { - $request = new Operations\UpdateTagRequest( - id: $id, - requestBody: $requestBody, - ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/tags/{id}', Operations\UpdateTagRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/tags'); $urlOverride = null; $options = ['http_errors' => false]; - $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); - if ($body !== null) { - $options = array_merge_recursive($options, $body); - } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); - $hookContext = new HookContext('updateTag', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('getTags', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -424,12 +418,12 @@ public function update(string $id, ?Operations\UpdateTagRequestBody $requestBody $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\TagSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\UpdateTagResponse( + $obj = $serializer->deserialize($responseData, 'array<\Dub\Models\Components\TagSchema>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\GetTagsResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - tagSchema: $obj); + tagSchemas: $obj); return $response; } else { @@ -542,27 +536,33 @@ public function update(string $id, ?Operations\UpdateTagRequestBody $requestBody } /** - * Delete a tag + * Update a tag * - * Delete a tag from the workspace. All existing links will still work, but they will no longer be associated with this tag. + * Update a tag in the workspace. * * @param string $id - * @return Operations\DeleteTagResponse + * @param ?Operations\UpdateTagRequestBody $requestBody + * @return Operations\UpdateTagResponse * @throws \Dub\Models\Errors\SDKException */ - public function delete(string $id): Operations\DeleteTagResponse + public function update(string $id, ?Operations\UpdateTagRequestBody $requestBody = null): Operations\UpdateTagResponse { - $request = new Operations\DeleteTagRequest( + $request = new Operations\UpdateTagRequest( id: $id, + requestBody: $requestBody, ); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/tags/{id}', Operations\DeleteTagRequest::class, $request); + $url = Utils\Utils::generateUrl($baseUrl, '/tags/{id}', Operations\UpdateTagRequest::class, $request); $urlOverride = null; $options = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); - $hookContext = new HookContext('deleteTag', null, $this->sdkConfiguration->securitySource); + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext('updateTag', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -589,12 +589,12 @@ public function delete(string $id): Operations\DeleteTagResponse $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\DeleteTagResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\DeleteTagResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Components\TagSchema', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\UpdateTagResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, - object: $obj); + tagSchema: $obj); return $response; } else { diff --git a/src/Track.php b/src/Track.php index ab19419..9ab3ccd 100644 --- a/src/Track.php +++ b/src/Track.php @@ -44,18 +44,20 @@ public function getUrl(string $baseUrl, array $urlVariables): string } /** - * Track a lead + * Track a customer * - * Track a lead for a short link. + * Track a customer for an authenticated workspace. * - * @param ?Operations\TrackLeadRequestBody $request - * @return Operations\TrackLeadResponse + * @param ?Operations\TrackCustomerRequestBody $request + * @return Operations\TrackCustomerResponse * @throws \Dub\Models\Errors\SDKException + * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. */ - public function lead(?Operations\TrackLeadRequestBody $request = null): Operations\TrackLeadResponse + public function customer(?Operations\TrackCustomerRequestBody $request = null): Operations\TrackCustomerResponse { + trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/track/lead'); + $url = Utils\Utils::generateUrl($baseUrl, '/track/customer'); $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); @@ -65,7 +67,7 @@ public function lead(?Operations\TrackLeadRequestBody $request = null): Operatio $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); - $hookContext = new HookContext('trackLead', null, $this->sdkConfiguration->securitySource); + $hookContext = new HookContext('trackCustomer', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -92,8 +94,8 @@ public function lead(?Operations\TrackLeadRequestBody $request = null): Operatio $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\TrackLeadResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\TrackLeadResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\TrackCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\TrackCustomerResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, @@ -210,18 +212,18 @@ public function lead(?Operations\TrackLeadRequestBody $request = null): Operatio } /** - * Track a sale + * Track a lead * - * Track a sale for a short link. + * Track a lead for a short link. * - * @param ?Operations\TrackSaleRequestBody $request - * @return Operations\TrackSaleResponse + * @param ?Operations\TrackLeadRequestBody $request + * @return Operations\TrackLeadResponse * @throws \Dub\Models\Errors\SDKException */ - public function sale(?Operations\TrackSaleRequestBody $request = null): Operations\TrackSaleResponse + public function lead(?Operations\TrackLeadRequestBody $request = null): Operations\TrackLeadResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/track/sale'); + $url = Utils\Utils::generateUrl($baseUrl, '/track/lead'); $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); @@ -231,7 +233,7 @@ public function sale(?Operations\TrackSaleRequestBody $request = null): Operatio $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); - $hookContext = new HookContext('trackSale', null, $this->sdkConfiguration->securitySource); + $hookContext = new HookContext('trackLead', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -258,8 +260,8 @@ public function sale(?Operations\TrackSaleRequestBody $request = null): Operatio $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\TrackSaleResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\TrackSaleResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\TrackLeadResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\TrackLeadResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, @@ -376,20 +378,18 @@ public function sale(?Operations\TrackSaleRequestBody $request = null): Operatio } /** - * Track a customer + * Track a sale * - * Track a customer for an authenticated workspace. + * Track a sale for a short link. * - * @param ?Operations\TrackCustomerRequestBody $request - * @return Operations\TrackCustomerResponse + * @param ?Operations\TrackSaleRequestBody $request + * @return Operations\TrackSaleResponse * @throws \Dub\Models\Errors\SDKException - * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. */ - public function customer(?Operations\TrackCustomerRequestBody $request = null): Operations\TrackCustomerResponse + public function sale(?Operations\TrackSaleRequestBody $request = null): Operations\TrackSaleResponse { - trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED); $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/track/customer'); + $url = Utils\Utils::generateUrl($baseUrl, '/track/sale'); $urlOverride = null; $options = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); @@ -399,7 +399,7 @@ public function customer(?Operations\TrackCustomerRequestBody $request = null): $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); - $hookContext = new HookContext('trackCustomer', null, $this->sdkConfiguration->securitySource); + $hookContext = new HookContext('trackSale', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); $httpRequest = Utils\Utils::removeHeaders($httpRequest); @@ -426,8 +426,8 @@ public function customer(?Operations\TrackCustomerRequestBody $request = null): $serializer = Utils\JSON::createSerializer(); $responseData = (string) $httpResponse->getBody(); - $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\TrackCustomerResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\TrackCustomerResponse( + $obj = $serializer->deserialize($responseData, '\Dub\Models\Operations\TrackSaleResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\TrackSaleResponse( statusCode: $statusCode, contentType: $contentType, rawResponse: $httpResponse, diff --git a/src/Utils/RequestBodies.php b/src/Utils/RequestBodies.php index 62e8ca4..a32029f 100644 --- a/src/Utils/RequestBodies.php +++ b/src/Utils/RequestBodies.php @@ -105,7 +105,7 @@ private function serializeMultipart(mixed $value): array } if ($metadata->file) { - $options['multipart'][] = $this->serializeMultipartFile($val); + $options['multipart'][] = $this->serializeMultipartFile($metadata->name, $val); } elseif ($metadata->json) { $serializer = JSON::createSerializer(); $options['multipart'][] = [ @@ -138,16 +138,16 @@ private function serializeMultipart(mixed $value): array } /** + * @param string $fieldName * @param mixed $value * @return array */ - private function serializeMultipartFile(mixed $value): array + private function serializeMultipartFile(string $fieldName, mixed $value): array { if (gettype($value) != 'object') { throw new \Exception('Invalid type for multipart/form-data file'); } - $name = ''; $filename = ''; $content = ''; @@ -164,17 +164,16 @@ private function serializeMultipartFile(mixed $value): array if ($metadata->content) { $content = $val; } else { - $name = $metadata->name; $filename = $val; } } - if (empty($name) || empty($filename) || empty($content)) { + if (empty($filename) || empty($content)) { throw new \Exception('Invalid multipart/form-data file'); } return [ - 'name' => $name, + 'name' => $fieldName, 'contents' => $content, 'filename' => $filename, ]; diff --git a/src/Utils/Utils.php b/src/Utils/Utils.php index b5dfc14..be1fd0f 100644 --- a/src/Utils/Utils.php +++ b/src/Utils/Utils.php @@ -251,6 +251,111 @@ public static function removeHeaders(RequestInterface $request): RequestInterfac return $request; } + /** + * urljoin joins a base URL and a relative URL. + * this is a PHP port of the Python urllib.urljoin function + * + * @param string $base + * @param string $rel + * @return string + */ + public static function urljoin(string $base, string $rel): string + { + $pbase = parse_url($base); + if ($pbase === false) { + throw new \InvalidArgumentException('Invalid base URL: '.$base); + } else { + $pbase = (array) $pbase; + } + $prel = parse_url($rel); + if ($prel === false) { + throw new \InvalidArgumentException('Invalid relative URL: '.$rel); + } else { + $prel = (array) $prel; + } + + $merged = array_merge($pbase, $prel); + if (array_key_exists('path', $pbase) && array_key_exists('path', $prel) && $prel['path'][0] != '/') { + // Relative path + $dir = preg_replace('@/[^/]*$@', '', $pbase['path']); + $merged['path'] = $dir.'/'.$prel['path']; + } elseif (array_key_exists('path', $pbase)) { + $merged['path'] = $pbase['path']; + } elseif (array_key_exists('path', $prel)) { + $merged['path'] = $prel['path']; + } else { + $merged['path'] = ''; + } + + // Get the path components, and remove the initial empty one + $pathParts = explode('/', $merged['path']); + array_shift($pathParts); + + $path = []; + $prevPart = ''; + foreach ($pathParts as $part) { + if ($part == '..' && count($path) > 0) { + // Cancel out the parent directory (if there's a parent to cancel) + $parent = array_pop($path); + // But if it was also a parent directory, leave it in + if ($parent == '..') { + array_push($path, $parent); + array_push($path, $part); + } + } elseif ($prevPart != '' || ($part != '.' && $part != '')) { + // Don't include empty or current-directory components + if ($part == '.') { + $part = ''; + } + array_push($path, $part); + } + $prevPart = $part; + } + $merged['path'] = '/'.implode('/', $path); + + $ret = ''; + if (isset($merged['scheme'])) { + $ret .= $merged['scheme'].':'; + } + + if (isset($merged['scheme']) || isset($merged['host'])) { + $ret .= '//'; + } + + if (isset($prel['host'])) { + $hostSource = $prel; + } else { + $hostSource = $pbase; + } + + // username, password, and port are associated with the hostname, not merged + if (isset($hostSource['host'])) { + if (isset($hostSource['user'])) { + $ret .= $hostSource['user']; + if (isset($hostSource['pass'])) { + $ret .= ':'.$hostSource['pass']; + } + $ret .= '@'; + } + $ret .= $hostSource['host']; + if (isset($hostSource['port'])) { + $ret .= ':'.$hostSource['port']; + } + } + + $ret .= $merged['path']; + + if (isset($prel['query'])) { + $ret .= '?'.$prel['query']; + } + + if (isset($prel['fragment'])) { + $ret .= '#'.$prel['fragment']; + } + + return $ret; + } + } function removePrefix(string $text, string $prefix): string