Skip to content

Commit

Permalink
Merge pull request #58 from dubinc/speakeasy-sdk-regen-1733444459
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate 0.11.5
  • Loading branch information
devkiran authored Dec 6, 2024
2 parents 2289921 + 9f6a6f0 commit 3383215
Show file tree
Hide file tree
Showing 38 changed files with 1,779 additions and 169 deletions.
27 changes: 20 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 43187d3e-7c3c-4c11-b5d4-4b2334fb6d96
management:
docChecksum: ebeafbab98f36580b94fa4a78ab949c3
docChecksum: da455826be171d9d1ff0d376f0695b24
docVersion: 0.0.1
speakeasyVersion: 1.448.2
generationVersion: 2.467.4
releaseVersion: 0.11.4
configChecksum: d3f345e68c310c8a86cf9438f15617de
speakeasyVersion: 1.453.0
generationVersion: 2.472.1
releaseVersion: 0.11.5
configChecksum: 7d70fbd2bde72316f690523b5ea79cd3
repoURL: https://github.com/dubinc/dub-php.git
installationURL: https://github.com/dubinc/dub-php
published: true
Expand Down Expand Up @@ -273,6 +273,19 @@ generatedFiles:
- src/DubBuilder.php
- src/EmbedTokens.php
- src/Events.php
- src/Hooks/AfterErrorContext.php
- src/Hooks/AfterErrorHook.php
- src/Hooks/AfterSuccessContext.php
- src/Hooks/AfterSuccessHook.php
- src/Hooks/BeforeRequestContext.php
- src/Hooks/BeforeRequestHook.php
- src/Hooks/ErrorResponseContext.php
- src/Hooks/FailEarlyException.php
- src/Hooks/HookContext.php
- src/Hooks/Hooks.php
- src/Hooks/SDKHooks.php
- src/Hooks/SDKInitHook.php
- src/Hooks/SDKRequestContext.php
- src/Links.php
- src/Metatags.php
- src/Models/Components/AnalyticsBrowsers.php
Expand Down Expand Up @@ -869,7 +882,7 @@ examples:
idOrSlug: "<value>"
responses:
"200":
application/json: {"id": "<id>", "name": "<value>", "slug": "<value>", "logo": "<value>", "inviteCode": "<value>", "plan": "business extra", "stripeId": "<value>", "billingCycleStart": "900.65", "paymentFailedAt": "<value>", "stripeConnectId": "<value>", "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", "referralLinkId": "<value>", "conversionEnabled": true, "dotLinkClaimed": true, "createdAt": "<value>", "users": [], "domains": [], "publishableKey": "<value>", "bankAccountName": "<value>", "partialAccountNumber": "<value>", "routingNumber": "<value>", "bankAccountVerified": false}
application/json: {"id": "<id>", "name": "<value>", "slug": "<value>", "logo": "<value>", "inviteCode": "<value>", "plan": "business extra", "stripeId": "<value>", "billingCycleStart": "900.65", "paymentFailedAt": "<value>", "stripeConnectId": "<value>", "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": "<value>", "users": [], "domains": [], "publishableKey": "<value>", "bankAccountName": "<value>", "partialAccountNumber": "<value>", "routingNumber": "<value>", "bankAccountVerified": false}
"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":
Expand All @@ -895,7 +908,7 @@ examples:
idOrSlug: "<value>"
responses:
"200":
application/json: {"id": "<id>", "name": "<value>", "slug": "<value>", "logo": "<value>", "inviteCode": "<value>", "plan": "enterprise", "stripeId": "<value>", "billingCycleStart": "245.55", "paymentFailedAt": "<value>", "stripeConnectId": "<value>", "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", "referralLinkId": "<value>", "conversionEnabled": false, "dotLinkClaimed": false, "createdAt": "<value>", "users": [], "domains": [], "publishableKey": "<value>", "bankAccountName": "<value>", "partialAccountNumber": "<value>", "routingNumber": "<value>", "bankAccountVerified": false}
application/json: {"id": "<id>", "name": "<value>", "slug": "<value>", "logo": "<value>", "inviteCode": "<value>", "plan": "enterprise", "stripeId": "<value>", "billingCycleStart": "245.55", "paymentFailedAt": "<value>", "stripeConnectId": "<value>", "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": "<value>", "users": [], "domains": [], "publishableKey": "<value>", "bankAccountName": "<value>", "partialAccountNumber": "<value>", "routingNumber": "<value>", "bankAccountVerified": false}
"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":
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
php:
version: 0.11.4
version: 0.11.5
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKException
flattenGlobalSecurity: true
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.448.2
speakeasyVersion: 1.453.0
sources:
dub:
sourceNamespace: dub
sourceRevisionDigest: sha256:9d15980874e61b0ff83224b26358510380a239a1c884e835d8e710bb70cd83ea
sourceBlobDigest: sha256:05e717ca7c8803f62c2536db9ec23d6f5c6ba9c19970b944c6500f280753d820
sourceRevisionDigest: sha256:ff35145df9477779b92bd354179241024be114e1dcf82cc21e4ab364002f9c3f
sourceBlobDigest: sha256:98d898001f0ef6455618c09c8c6a368877c2fc520cb3d1ed70a17728d4775a9e
tags:
- latest
- speakeasy-sdk-regen-1732925995
- speakeasy-sdk-regen-1733444459
- 0.0.1
targets:
my-first-target:
source: dub
sourceNamespace: dub
sourceRevisionDigest: sha256:9d15980874e61b0ff83224b26358510380a239a1c884e835d8e710bb70cd83ea
sourceBlobDigest: sha256:05e717ca7c8803f62c2536db9ec23d6f5c6ba9c19970b944c6500f280753d820
sourceRevisionDigest: sha256:ff35145df9477779b92bd354179241024be114e1dcf82cc21e4ab364002f9c3f
sourceBlobDigest: sha256:98d898001f0ef6455618c09c8c6a368877c2fc520cb3d1ed70a17728d4775a9e
codeSamplesNamespace: code-samples-php-my-first-target
codeSamplesRevisionDigest: sha256:907fd062e7b363d3be59b05ffd7cd78def0567998d6f6fd2c84c1fe99cabd494
codeSamplesRevisionDigest: sha256:58c5e4d251f54966916d98b7077a81c37ec03b04513dbb619f086377f667e3a4
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,4 +490,14 @@ Based on:
### Generated
- [php v0.11.4] .
### Releases
- [Composer v0.11.4] https://packagist.org/packages/dub/dub-php#v0.11.4 - .
- [Composer v0.11.4] https://packagist.org/packages/dub/dub-php#v0.11.4 - .

## 2024-12-06 00:20:55
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.453.0 (2.472.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [php v0.11.5] .
### Releases
- [Composer v0.11.5] https://packagist.org/packages/dub/dub-php#v0.11.5 - .
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"./vendor/bin/phpunit --testdox --display-warnings --colors=always"
],
"stan": [
"./vendor/bin/phpstan analyse --memory-limit=2g"
"./vendor/bin/phpstan analyse --memory-limit=2g --error-format=table"
]
},
"script-descriptions": {
Expand Down
1 change: 0 additions & 1 deletion docs/Models/Components/WorkspaceSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
| `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. |
| `referralLinkId` | *string* | :heavy_check_mark: | The ID of the referral link of the workspace. |
| `flags` | array<string, *bool*> | :heavy_minus_sign: | The feature flags of the workspace, indicating which features are enabled. |
| `publishableKey` | *string* | :heavy_check_mark: | The publishable key of the workspace. |
| `bankAccountName` | *string* | :heavy_check_mark: | [BETA – Dub Partners]: The name of the connected bank account. |
Expand Down
45 changes: 40 additions & 5 deletions src/Analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Dub;

use Dub\Hooks\HookContext;
use Dub\Models\Operations;
use Speakeasy\Serializer\DeserializationContext;

Expand Down Expand Up @@ -59,19 +60,35 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
$options = ['http_errors' => false];

$qp = Utils\Utils::getQueryParams(Operations\RetrieveAnalyticsRequest::class, $request, $urlOverride);

$options = array_merge_recursive($options, $qp);
$options['headers']['Accept'] = 'application/json';
$options['headers']['user-agent'] = $this->sdkConfiguration->userAgent;
$httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url);


$httpResponse = $this->sdkConfiguration->securityClient->send($httpRequest, $options);
$hookContext = new HookContext('retrieveAnalytics', 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 {
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
if ($res !== null) {
$httpResponse = $res;
}
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';

$statusCode = $httpResponse->getStatusCode();
if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode == 409 || $statusCode == 410 || $statusCode == 422 || $statusCode == 429 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
if ($res !== null) {
$httpResponse = $res;
}
}
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\Components\AnalyticsCount|array<\Dub\Models\Components\AnalyticsTimeseries>|array<\Dub\Models\Components\AnalyticsContinents>|array<\Dub\Models\Components\AnalyticsCountries>|array<\Dub\Models\Components\AnalyticsCities>|array<\Dub\Models\Components\AnalyticsDevices>|array<\Dub\Models\Components\AnalyticsBrowsers>|array<\Dub\Models\Components\AnalyticsOS>|array<\Dub\Models\Components\AnalyticsTriggers>|array<\Dub\Models\Components\AnalyticsReferers>|array<\Dub\Models\Components\AnalyticsRefererUrls>|array<\Dub\Models\Components\AnalyticsTopLinks>|array<\Dub\Models\Components\AnalyticsTopUrls>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -87,6 +104,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 400) {
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\Errors\BadRequest', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -96,6 +115,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 401) {
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\Errors\Unauthorized', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -105,6 +126,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 403) {
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\Errors\Forbidden', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -114,6 +137,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 404) {
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\Errors\NotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -123,6 +148,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 409) {
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\Errors\Conflict', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -132,6 +159,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 410) {
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\Errors\InviteExpired', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -141,6 +170,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 422) {
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\Errors\UnprocessableEntity', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -150,6 +181,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 429) {
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\Errors\RateLimitExceeded', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand All @@ -159,6 +192,8 @@ public function retrieve(?Operations\RetrieveAnalyticsRequest $request = null):
}
} elseif ($statusCode == 500) {
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\Errors\InternalServerError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
Expand Down
Loading

0 comments on commit 3383215

Please sign in to comment.