diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5772959..32a0949 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,22 +1,24 @@ lockVersion: 2.0.0 id: 8c24a12b-d2f1-466a-bdaa-6d83a049a679 management: - docChecksum: 293282b19953a337b7a810122b9b8ffc + docChecksum: 460ff9605d042257d29b142feb929348 docVersion: v1 - speakeasyVersion: 1.469.12 - generationVersion: 2.493.34 - releaseVersion: 0.1.4 - configChecksum: e7a1ea77238fea976a13a337a8df7ee3 + speakeasyVersion: 1.487.0 + generationVersion: 2.506.0 + releaseVersion: 0.1.5 + configChecksum: e875c2911ac71e8e02a64c7fbe30a132 + repoURL: https://github.com/clerk/clerk-sdk-php.git + installationURL: https://github.com/clerk/clerk-sdk-php published: true features: php: constsAndDefaults: 0.2.0 - core: 3.7.9 + core: 3.7.13 deprecations: 2.81.1 examples: 2.81.5 flattening: 2.81.1 globalSecurity: 2.81.7 - globalSecurityFlattening: 0.1.1 + globalSecurityFlattening: 0.1.2 globalServerURLs: 2.82.1 groups: 2.81.2 methodArguments: 0.1.0 @@ -167,7 +169,6 @@ generatedFiles: - docs/Models/Components/TicketVerificationStrategy.md - docs/Models/Components/TotalCount.md - docs/Models/Components/TotalCountObject.md - - docs/Models/Components/Type.md - docs/Models/Components/User.md - docs/Models/Components/UserObject.md - docs/Models/Components/Verification.md @@ -255,8 +256,6 @@ generatedFiles: - docs/Models/Operations/CreateTestingTokenResponse.md - docs/Models/Operations/CreateUserRequestBody.md - docs/Models/Operations/CreateUserResponse.md - - docs/Models/Operations/CreateUserTOTPRequest.md - - docs/Models/Operations/CreateUserTOTPResponse.md - docs/Models/Operations/CreateWaitlistEntryRequestBody.md - docs/Models/Operations/CreateWaitlistEntryResponse.md - docs/Models/Operations/DeleteAllowlistIdentifierRequest.md @@ -708,7 +707,6 @@ generatedFiles: - src/Models/Components/TicketVerificationStrategy.php - src/Models/Components/TotalCount.php - src/Models/Components/TotalCountObject.php - - src/Models/Components/Type.php - src/Models/Components/User.php - src/Models/Components/UserObject.php - src/Models/Components/VerificationAdmin.php @@ -795,8 +793,6 @@ generatedFiles: - src/Models/Operations/CreateTestingTokenResponse.php - src/Models/Operations/CreateUserRequestBody.php - src/Models/Operations/CreateUserResponse.php - - src/Models/Operations/CreateUserTOTPRequest.php - - src/Models/Operations/CreateUserTOTPResponse.php - src/Models/Operations/CreateWaitlistEntryRequestBody.php - src/Models/Operations/CreateWaitlistEntryResponse.php - src/Models/Operations/DeleteAllowlistIdentifierRequest.php @@ -2194,7 +2190,7 @@ examples: offset: 0 responses: "200": - application/json: {"data": [{"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "callback_url": "https://definite-deer.com", "authorize_url": "https://productive-affect.net", "token_fetch_url": "https://black-poetry.name/", "user_info_url": "https://acidic-avalanche.info", "discovery_url": "https://neglected-plastic.biz", "token_introspection_url": "https://crooked-overload.name/", "created_at": 485729, "updated_at": 73227}, {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "callback_url": "https://ugly-jungle.com", "authorize_url": "https://torn-affiliate.org/", "token_fetch_url": "https://unwilling-comparison.com/", "user_info_url": "https://concrete-incandescence.info", "discovery_url": "https://secret-bob.com/", "token_introspection_url": "https://memorable-overcoat.com", "created_at": 432930, "updated_at": 480616}, {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": true, "scopes": "", "callback_url": "https://tempting-handle.org", "authorize_url": "https://imaginative-cap.biz/", "token_fetch_url": "https://animated-ostrich.org", "user_info_url": "https://bowed-poppy.name", "discovery_url": "https://hidden-jet.com/", "token_introspection_url": "https://odd-sustenance.info", "created_at": 838930, "updated_at": 816637}], "total_count": 996014} + application/json: {"data": [{"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "redirect_uris": ["", "", ""], "callback_url": "https://definite-deer.com", "authorize_url": "https://productive-affect.net", "token_fetch_url": "https://black-poetry.name/", "user_info_url": "https://acidic-avalanche.info", "discovery_url": "https://neglected-plastic.biz", "token_introspection_url": "https://crooked-overload.name/", "created_at": 485729, "updated_at": 73227}, {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "redirect_uris": ["", ""], "callback_url": "https://ugly-jungle.com", "authorize_url": "https://torn-affiliate.org/", "token_fetch_url": "https://unwilling-comparison.com/", "user_info_url": "https://concrete-incandescence.info", "discovery_url": "https://secret-bob.com/", "token_introspection_url": "https://memorable-overcoat.com", "created_at": 432930, "updated_at": 480616}, {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": true, "scopes": "", "redirect_uris": ["", ""], "callback_url": "https://tempting-handle.org", "authorize_url": "https://imaginative-cap.biz/", "token_fetch_url": "https://animated-ostrich.org", "user_info_url": "https://bowed-poppy.name", "discovery_url": "https://hidden-jet.com/", "token_introspection_url": "https://odd-sustenance.info", "created_at": 838930, "updated_at": 816637}], "total_count": 996014} "400": application/json: {"errors": []} CreateOAuthApplication: @@ -2203,7 +2199,7 @@ examples: application/json: {"name": "", "callback_url": "https://probable-heating.com/", "scopes": "profile email public_metadata"} responses: "200": - application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": true, "scopes": "", "callback_url": "https://well-documented-cd.biz", "authorize_url": "https://stable-skean.name/", "token_fetch_url": "https://well-worn-formation.biz", "user_info_url": "https://enlightened-curl.com/", "discovery_url": "https://probable-heating.com/", "token_introspection_url": "https://standard-utilization.com/", "created_at": 322997, "updated_at": 185693} + application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": true, "scopes": "", "redirect_uris": [""], "callback_url": "https://well-documented-cd.biz", "authorize_url": "https://stable-skean.name/", "token_fetch_url": "https://well-worn-formation.biz", "user_info_url": "https://enlightened-curl.com/", "discovery_url": "https://probable-heating.com/", "token_introspection_url": "https://standard-utilization.com/", "created_at": 322997, "updated_at": 185693} "400": application/json: {"errors": []} GetOAuthApplication: @@ -2213,7 +2209,7 @@ examples: oauth_application_id: "" responses: "200": - application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "callback_url": "https://necessary-lender.org", "authorize_url": "https://knowledgeable-diversity.biz/", "token_fetch_url": "https://jittery-sermon.com", "user_info_url": "https://genuine-bowler.name/", "discovery_url": "https://normal-making.name", "token_introspection_url": "https://lavish-ice-cream.biz", "created_at": 805876, "updated_at": 380699} + application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "redirect_uris": ["", ""], "callback_url": "https://necessary-lender.org", "authorize_url": "https://knowledgeable-diversity.biz/", "token_fetch_url": "https://jittery-sermon.com", "user_info_url": "https://genuine-bowler.name/", "discovery_url": "https://normal-making.name", "token_introspection_url": "https://lavish-ice-cream.biz", "created_at": 805876, "updated_at": 380699} "403": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} UpdateOAuthApplication: @@ -2225,9 +2221,11 @@ examples: application/json: {"scopes": "profile email public_metadata private_metadata"} responses: "200": - application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "callback_url": "https://grown-worth.name", "authorize_url": "https://worthwhile-avalanche.org/", "token_fetch_url": "https://general-digit.com/", "user_info_url": "https://uniform-euphonium.info", "discovery_url": "https://passionate-flu.org", "token_introspection_url": "https://lumbering-wheel.com", "created_at": 771203, "updated_at": 693508} + application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "redirect_uris": ["", "", ""], "callback_url": "https://grown-worth.name", "authorize_url": "https://worthwhile-avalanche.org/", "token_fetch_url": "https://general-digit.com/", "user_info_url": "https://uniform-euphonium.info", "discovery_url": "https://passionate-flu.org", "token_introspection_url": "https://lumbering-wheel.com", "created_at": 771203, "updated_at": 693508} "403": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}]} + "400": + application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} DeleteOAuthApplication: speakeasy-default-delete-O-auth-application: parameters: @@ -2245,7 +2243,7 @@ examples: oauth_application_id: "" responses: "200": - application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "callback_url": "https://memorable-tray.biz/", "authorize_url": "https://round-plumber.info", "token_fetch_url": "https://annual-councilman.com", "user_info_url": "https://blank-lifestyle.name", "discovery_url": "https://enchanting-language.org", "token_introspection_url": "https://tempting-popularity.net/", "created_at": 522183, "updated_at": 873135} + application/json: {"object": "oauth_application", "id": "", "instance_id": "", "name": "", "client_id": "", "public": false, "scopes": "", "redirect_uris": ["", "", ""], "callback_url": "https://memorable-tray.biz/", "authorize_url": "https://round-plumber.info", "token_fetch_url": "https://annual-councilman.com", "user_info_url": "https://blank-lifestyle.name", "discovery_url": "https://enchanting-language.org", "token_introspection_url": "https://tempting-popularity.net/", "created_at": 522183, "updated_at": 873135} "403": application/json: {"errors": [{"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}, {"message": "", "long_message": "", "code": ""}]} ListSAMLConnections: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 64eb6e5..dfc6e14 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false php: - version: 0.1.4 + version: 0.1.5 additionalDependencies: autoload-dev: Clerk\Backend\Tests\: Tests/ diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1f98cbc..633687b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.469.12 +speakeasyVersion: 1.487.0 sources: backend-php: sourceNamespace: clerk-openapi @@ -14,19 +14,20 @@ sources: - latest clerk-openapi: sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:7669e744dd69717cc754742276d79ab6f8951ffd9193654c24363edf0394bc21 - sourceBlobDigest: sha256:6fdff14cae98538645534e6d753b3d0343b46cc748151c493d99dca7ca717ffd + sourceRevisionDigest: sha256:d96e5fae5e70150d16a852bb4296cea1753f9b3596ca5e8e674ea6b8b9702cb6 + sourceBlobDigest: sha256:23a98bea3a29fbeb584e5e92112fa5acdafba1d59af1b3df7c639fe70af12aa4 tags: - latest + - speakeasy-sdk-regen-1738024123 - v1 targets: clerk-php: source: clerk-openapi sourceNamespace: clerk-openapi - sourceRevisionDigest: sha256:7669e744dd69717cc754742276d79ab6f8951ffd9193654c24363edf0394bc21 - sourceBlobDigest: sha256:6fdff14cae98538645534e6d753b3d0343b46cc748151c493d99dca7ca717ffd + sourceRevisionDigest: sha256:d96e5fae5e70150d16a852bb4296cea1753f9b3596ca5e8e674ea6b8b9702cb6 + sourceBlobDigest: sha256:23a98bea3a29fbeb584e5e92112fa5acdafba1d59af1b3df7c639fe70af12aa4 codeSamplesNamespace: clerk-openapi-php-code-samples - codeSamplesRevisionDigest: sha256:d760121c650fb22bcf246e2d830011efc8c790e936d4b2a96f0dd2b61d7b76aa + codeSamplesRevisionDigest: sha256:9d2ebdb5485a270eafd634dce6a3381181ff2566edc0d831958af326d19f1198 my-first-target: source: clerk-backend-php sourceNamespace: clerk-openapi diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 76bf21c..68b4532 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -18,7 +18,6 @@ targets: packagist: username: $packagist_username token: $packagist_token - packageName: clerkinc/backend-php codeSamples: registry: location: registry.speakeasyapi.dev/clerk/clerk/clerk-openapi-php-code-samples diff --git a/README.md b/README.md index 23a8228..a46ba96 100644 --- a/README.md +++ b/README.md @@ -388,7 +388,6 @@ if ($response->statusCode === 200) { * [ban](docs/sdks/users/README.md#ban) - Ban a user * [create](docs/sdks/users/README.md#create) - Create a new user -* [createTOTP](docs/sdks/users/README.md#createtotp) - Create a TOTP for a user * [deleteBackupCodes](docs/sdks/users/README.md#deletebackupcodes) - Disable all user's Backup codes * [deleteExternalAccount](docs/sdks/users/README.md#deleteexternalaccount) - Delete External Account * [deleteTotp](docs/sdks/users/README.md#deletetotp) - Delete all the user's TOTPs diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..be4352c --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,11 @@ + + +## 2025-02-07 00:28:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.487.0 (2.506.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v0.1.5] . +### Releases +- [Composer v0.1.5] https://packagist.org/packages/clerkinc/backend-php#v0.1.5 - . \ No newline at end of file diff --git a/docs/Models/Components/IdentificationLink.md b/docs/Models/Components/IdentificationLink.md index d3ec6bc..61b1e14 100644 --- a/docs/Models/Components/IdentificationLink.md +++ b/docs/Models/Components/IdentificationLink.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `type` | [Components\Type](../../Models/Components/Type.md) | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/OAuthApplication.md b/docs/Models/Components/OAuthApplication.md index ec8be4c..cb274dc 100644 --- a/docs/Models/Components/OAuthApplication.md +++ b/docs/Models/Components/OAuthApplication.md @@ -3,20 +3,21 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `object` | [Components\OAuthApplicationObject](../../Models/Components/OAuthApplicationObject.md) | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `instanceId` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `clientId` | *string* | :heavy_check_mark: | N/A | -| `public` | *bool* | :heavy_check_mark: | N/A | -| `scopes` | *string* | :heavy_check_mark: | N/A | -| `callbackUrl` | *string* | :heavy_check_mark: | N/A | -| `authorizeUrl` | *string* | :heavy_check_mark: | N/A | -| `tokenFetchUrl` | *string* | :heavy_check_mark: | N/A | -| `userInfoUrl` | *string* | :heavy_check_mark: | N/A | -| `discoveryUrl` | *string* | :heavy_check_mark: | N/A | -| `tokenIntrospectionUrl` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| -| `updatedAt` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `object` | [Components\OAuthApplicationObject](../../Models/Components/OAuthApplicationObject.md) | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `instanceId` | *string* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `clientId` | *string* | :heavy_check_mark: | N/A | +| `public` | *bool* | :heavy_check_mark: | N/A | +| `scopes` | *string* | :heavy_check_mark: | N/A | +| `redirectUris` | array<*string*> | :heavy_check_mark: | N/A | +| ~~`callbackUrl`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `authorizeUrl` | *string* | :heavy_check_mark: | N/A | +| `tokenFetchUrl` | *string* | :heavy_check_mark: | N/A | +| `userInfoUrl` | *string* | :heavy_check_mark: | N/A | +| `discoveryUrl` | *string* | :heavy_check_mark: | N/A | +| `tokenIntrospectionUrl` | *string* | :heavy_check_mark: | N/A | +| `createdAt` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| \ No newline at end of file diff --git a/docs/Models/Components/OAuthApplicationWithSecret.md b/docs/Models/Components/OAuthApplicationWithSecret.md index 5d56bc7..d93b603 100644 --- a/docs/Models/Components/OAuthApplicationWithSecret.md +++ b/docs/Models/Components/OAuthApplicationWithSecret.md @@ -3,21 +3,22 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `object` | [Components\OAuthApplicationWithSecretObject](../../Models/Components/OAuthApplicationWithSecretObject.md) | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `instanceId` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `clientId` | *string* | :heavy_check_mark: | N/A | -| `public` | *bool* | :heavy_check_mark: | N/A | -| `scopes` | *string* | :heavy_check_mark: | N/A | -| `callbackUrl` | *string* | :heavy_check_mark: | N/A | -| `authorizeUrl` | *string* | :heavy_check_mark: | N/A | -| `tokenFetchUrl` | *string* | :heavy_check_mark: | N/A | -| `userInfoUrl` | *string* | :heavy_check_mark: | N/A | -| `discoveryUrl` | *string* | :heavy_check_mark: | N/A | -| `tokenIntrospectionUrl` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| -| `updatedAt` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| -| `clientSecret` | *?string* | :heavy_minus_sign: | Empty if public client.
| \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `object` | [Components\OAuthApplicationWithSecretObject](../../Models/Components/OAuthApplicationWithSecretObject.md) | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `instanceId` | *string* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `clientId` | *string* | :heavy_check_mark: | N/A | +| `public` | *bool* | :heavy_check_mark: | N/A | +| `scopes` | *string* | :heavy_check_mark: | N/A | +| `redirectUris` | array<*string*> | :heavy_check_mark: | N/A | +| ~~`callbackUrl`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `authorizeUrl` | *string* | :heavy_check_mark: | N/A | +| `tokenFetchUrl` | *string* | :heavy_check_mark: | N/A | +| `userInfoUrl` | *string* | :heavy_check_mark: | N/A | +| `discoveryUrl` | *string* | :heavy_check_mark: | N/A | +| `tokenIntrospectionUrl` | *string* | :heavy_check_mark: | N/A | +| `createdAt` | *int* | :heavy_check_mark: | Unix timestamp of creation.
| +| `updatedAt` | *int* | :heavy_check_mark: | Unix timestamp of last update.
| +| `clientSecret` | *?string* | :heavy_minus_sign: | Empty if public client.
| \ No newline at end of file diff --git a/docs/Models/Components/Type.md b/docs/Models/Components/Type.md deleted file mode 100644 index d0762fe..0000000 --- a/docs/Models/Components/Type.md +++ /dev/null @@ -1,14 +0,0 @@ -# Type - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `OauthGoogle` | oauth_google | -| `OauthMock` | oauth_mock | -| `Saml` | saml | -| `OauthApple` | oauth_apple | -| `OauthDiscord` | oauth_discord | -| `OauthMicrosoft` | oauth_microsoft | -| `OauthGithub` | oauth_github | \ No newline at end of file diff --git a/docs/Models/Operations/CreateOAuthApplicationRequestBody.md b/docs/Models/Operations/CreateOAuthApplicationRequestBody.md index 93631fe..501f6af 100644 --- a/docs/Models/Operations/CreateOAuthApplicationRequestBody.md +++ b/docs/Models/Operations/CreateOAuthApplicationRequestBody.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *string* | :heavy_check_mark: | The name of the new OAuth application | | -| `callbackUrl` | *?string* | :heavy_minus_sign: | The callback URL of the new OAuth application | | +| `redirectUris` | array<*string*> | :heavy_minus_sign: | An array of redirect URIs of the new OAuth application | | +| ~~`callbackUrl`~~ | *?string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The callback URL of the new OAuth application | | | `scopes` | *?string* | :heavy_minus_sign: | Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. | profile email public_metadata | -| `public` | *?bool* | :heavy_minus_sign: | If true, this client is public and cannot securely store a client secret.
Only the authorization code flow with proof key for code exchange (PKCE) may be used.
Public clients cannot be updated to be confidential clients, and vice versa. | | \ No newline at end of file +| `public` | *?bool* | :heavy_minus_sign: | If true, this client is public and you can use the Proof Key of Code Exchange (PKCE) flow. | | \ No newline at end of file diff --git a/docs/Models/Operations/CreateUserTOTPRequest.md b/docs/Models/Operations/CreateUserTOTPRequest.md deleted file mode 100644 index d12e0c5..0000000 --- a/docs/Models/Operations/CreateUserTOTPRequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# CreateUserTOTPRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `userId` | *string* | :heavy_check_mark: | The ID of the user for whom the TOTP is being created. | \ No newline at end of file diff --git a/docs/Models/Operations/CreateUserTOTPResponse.md b/docs/Models/Operations/CreateUserTOTPResponse.md deleted file mode 100644 index d0e105f..0000000 --- a/docs/Models/Operations/CreateUserTOTPResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateUserTOTPResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `totp` | array | :heavy_minus_sign: | A TOTP (Time-based One-Time Password) | \ No newline at end of file diff --git a/docs/Models/Operations/GetUserListRequest.md b/docs/Models/Operations/GetUserListRequest.md index 53030eb..40ea42d 100644 --- a/docs/Models/Operations/GetUserListRequest.md +++ b/docs/Models/Operations/GetUserListRequest.md @@ -17,6 +17,7 @@ | `phoneNumberQuery` | *?string* | :heavy_minus_sign: | Returns users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`. | | | `usernameQuery` | *?string* | :heavy_minus_sign: | Returns users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`. | | | `nameQuery` | *?string* | :heavy_minus_sign: | Returns users with names that match the given query, via case-insensitive partial match. | | +| `banned` | *?bool* | :heavy_minus_sign: | Returns users which are either banned (`banned=true`) or not banned (`banned=false`). | | | `lastActiveAtBefore` | *?int* | :heavy_minus_sign: | Returns users whose last session activity was before the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23. | 1700690400000 | | `lastActiveAtAfter` | *?int* | :heavy_minus_sign: | Returns users whose last session activity was after the given date (with millisecond precision).
Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23. | 1700690400000 | | ~~`lastActiveAtSince`~~ | *?int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Returns users that had session activity since the given date.
Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day.
Deprecated in favor of `last_active_at_after`. | 1700690400000 | diff --git a/docs/Models/Operations/GetUsersCountRequest.md b/docs/Models/Operations/GetUsersCountRequest.md index 7bce373..c78f577 100644 --- a/docs/Models/Operations/GetUsersCountRequest.md +++ b/docs/Models/Operations/GetUsersCountRequest.md @@ -14,4 +14,5 @@ | `query` | *?string* | :heavy_minus_sign: | Counts users that match the given query.
For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names.
The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well. | | `emailAddressQuery` | *?string* | :heavy_minus_sign: | Counts users with emails that match the given query, via case-insensitive partial match.
For example, `email_address_query=ello` will match a user with the email `HELLO@example.com`,
and will be included in the resulting count. | | `phoneNumberQuery` | *?string* | :heavy_minus_sign: | Counts users with phone numbers that match the given query, via case-insensitive partial match.
For example, `phone_number_query=555` will match a user with the phone number `+1555xxxxxxx`,
and will be included in the resulting count. | -| `usernameQuery` | *?string* | :heavy_minus_sign: | Counts users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`,
and will be included in the resulting count. | \ No newline at end of file +| `usernameQuery` | *?string* | :heavy_minus_sign: | Counts users with usernames that match the given query, via case-insensitive partial match.
For example, `username_query=CoolUser` will match a user with the username `SomeCoolUser`,
and will be included in the resulting count. | +| `banned` | *?bool* | :heavy_minus_sign: | Counts users which are either banned (`banned=true`) or not banned (`banned=false`). | \ No newline at end of file diff --git a/docs/Models/Operations/UpdateOAuthApplicationRequestBody.md b/docs/Models/Operations/UpdateOAuthApplicationRequestBody.md index 31e0aea..4f910c2 100644 --- a/docs/Models/Operations/UpdateOAuthApplicationRequestBody.md +++ b/docs/Models/Operations/UpdateOAuthApplicationRequestBody.md @@ -5,6 +5,8 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `public` | *?bool* | :heavy_minus_sign: | If true, this client is public and you can use the Proof Key of Code Exchange (PKCE) flow. | | | `name` | *?string* | :heavy_minus_sign: | The new name of the OAuth application | | -| `callbackUrl` | *?string* | :heavy_minus_sign: | The new callback URL of the OAuth application | | +| `redirectUris` | array<*string*> | :heavy_minus_sign: | An array of redirect URIs of the new OAuth application | | +| ~~`callbackUrl`~~ | *?string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The new callback URL of the OAuth application | | | `scopes` | *?string* | :heavy_minus_sign: | Define the allowed scopes for the new OAuth applications that dictate the user payload of the OAuth user info endpoint. Available scopes are `profile`, `email`, `public_metadata`, `private_metadata`. Provide the requested scopes as a string, separated by spaces. | profile email public_metadata private_metadata | \ No newline at end of file diff --git a/docs/sdks/oauthapplications/README.md b/docs/sdks/oauthapplications/README.md index c5f9d0e..3b6cebc 100644 --- a/docs/sdks/oauthapplications/README.md +++ b/docs/sdks/oauthapplications/README.md @@ -36,7 +36,6 @@ $sdk = Backend\ClerkBackend::builder() $request = new Operations\CreateOAuthApplicationRequestBody( name: '', - scopes: 'profile email public_metadata', ); $response = $sdk->oauthApplications->create( @@ -281,9 +280,7 @@ $sdk = Backend\ClerkBackend::builder() ) ->build(); -$requestBody = new Operations\UpdateOAuthApplicationRequestBody( - scopes: 'profile email public_metadata private_metadata', -); +$requestBody = new Operations\UpdateOAuthApplicationRequestBody(); $response = $sdk->oauthApplications->update( oauthApplicationId: '', @@ -311,5 +308,5 @@ if ($response->oAuthApplication !== null) { | Error Type | Status Code | Content Type | | ------------------- | ------------------- | ------------------- | -| Errors\ClerkErrors | 403, 404, 422 | application/json | +| Errors\ClerkErrors | 400, 403, 404, 422 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 26491da..7d911e1 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -10,7 +10,6 @@ The user object represents a user that has successfully signed up to your applic * [ban](#ban) - Ban a user * [create](#create) - Create a new user -* [createTOTP](#createtotp) - Create a TOTP for a user * [deleteBackupCodes](#deletebackupcodes) - Disable all user's Backup codes * [deleteExternalAccount](#deleteexternalaccount) - Delete External Account * [deleteTotp](#deletetotp) - Delete all the user's TOTPs @@ -135,55 +134,6 @@ if ($response->user !== null) { | Errors\ClerkErrors | 400, 401, 403, 422 | application/json | | Errors\SDKException | 4XX, 5XX | \*/\* | -## createTOTP - -Creates a TOTP (Time-based One-Time Password) for a given user, returning both the TOTP secret and the URI. - - -### Example Usage - -```php -declare(strict_types=1); - -require 'vendor/autoload.php'; - -use Clerk\Backend; - -$sdk = Backend\ClerkBackend::builder() - ->setSecurity( - '' - ) - ->build(); - - - -$response = $sdk->users->createTOTP( - userId: '' -); - -if ($response->totp !== null) { - // handle response -} -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `userId` | *string* | :heavy_check_mark: | The ID of the user for whom the TOTP is being created. | - -### Response - -**[?Operations\CreateUserTOTPResponse](../../Models/Operations/CreateUserTOTPResponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------- | ------------------- | ------------------- | -| Errors\ClerkErrors | 403, 404 | application/json | -| Errors\ClerkErrors | 500 | application/json | -| Errors\SDKException | 4XX, 5XX | \*/\* | - ## deleteBackupCodes Disable all of a user's backup codes. diff --git a/src/ActorTokens.php b/src/ActorTokens.php index f2449a3..0714592 100644 --- a/src/ActorTokens.php +++ b/src/ActorTokens.php @@ -80,11 +80,11 @@ public function create(?Operations\CreateActorTokenRequestBody $request = null, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -101,7 +101,7 @@ public function create(?Operations\CreateActorTokenRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -112,9 +112,9 @@ public function create(?Operations\CreateActorTokenRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -155,11 +155,11 @@ public function revoke(string $actorTokenId, ?Options $options = null): Operatio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -176,7 +176,7 @@ public function revoke(string $actorTokenId, ?Options $options = null): Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -187,9 +187,9 @@ public function revoke(string $actorTokenId, ?Options $options = null): Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/AllowlistBlocklist.php b/src/AllowlistBlocklist.php index 7e45b08..54e00eb 100644 --- a/src/AllowlistBlocklist.php +++ b/src/AllowlistBlocklist.php @@ -79,11 +79,11 @@ public function createAllowlistIdentifier(?Operations\CreateAllowlistIdentifierR $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +100,7 @@ public function createAllowlistIdentifier(?Operations\CreateAllowlistIdentifierR } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -111,9 +111,9 @@ public function createAllowlistIdentifier(?Operations\CreateAllowlistIdentifierR } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -155,11 +155,11 @@ public function createBlocklistIdentifier(?Operations\CreateBlocklistIdentifierR $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -176,7 +176,7 @@ public function createBlocklistIdentifier(?Operations\CreateBlocklistIdentifierR } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -187,9 +187,9 @@ public function createBlocklistIdentifier(?Operations\CreateBlocklistIdentifierR } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -230,11 +230,11 @@ public function deleteBlocklistIdentifier(string $identifierId, ?Options $option $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -251,7 +251,7 @@ public function deleteBlocklistIdentifier(string $identifierId, ?Options $option } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -262,9 +262,9 @@ public function deleteBlocklistIdentifier(string $identifierId, ?Options $option } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -301,11 +301,11 @@ public function listAllowlistIdentifiers(?Options $options = null): Operations\L $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 402 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '402', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -322,7 +322,7 @@ public function listAllowlistIdentifiers(?Options $options = null): Operations\L } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [401, 402])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401', '402'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -333,9 +333,9 @@ public function listAllowlistIdentifiers(?Options $options = null): Operations\L } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/AllowlistIdentifiers.php b/src/AllowlistIdentifiers.php index f55f5b2..68cce99 100644 --- a/src/AllowlistIdentifiers.php +++ b/src/AllowlistIdentifiers.php @@ -78,11 +78,11 @@ public function delete(string $identifierId, ?Options $options = null): Operatio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -99,7 +99,7 @@ public function delete(string $identifierId, ?Options $options = null): Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -110,9 +110,9 @@ public function delete(string $identifierId, ?Options $options = null): Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/BetaFeatures.php b/src/BetaFeatures.php index fa57a38..32443de 100644 --- a/src/BetaFeatures.php +++ b/src/BetaFeatures.php @@ -83,11 +83,11 @@ public function changeProductionInstanceDomain(?Operations\ChangeProductionInsta $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 202) { + if (Utils\Utils::matchStatusCodes($statusCode, ['202'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\ChangeProductionInstanceDomainResponse( @@ -95,7 +95,7 @@ public function changeProductionInstanceDomain(?Operations\ChangeProductionInsta contentType: $contentType, rawResponse: $httpResponse ); - } elseif (in_array($statusCode, [400, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -106,9 +106,9 @@ public function changeProductionInstanceDomain(?Operations\ChangeProductionInsta } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -150,11 +150,11 @@ public function updateInstanceSettings(?Operations\UpdateInstanceAuthConfigReque $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -171,7 +171,7 @@ public function updateInstanceSettings(?Operations\UpdateInstanceAuthConfigReque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -182,9 +182,9 @@ public function updateInstanceSettings(?Operations\UpdateInstanceAuthConfigReque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -232,11 +232,11 @@ public function updateDomain(?Operations\UpdateProductionInstanceDomainRequestBo $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 202) { + if (Utils\Utils::matchStatusCodes($statusCode, ['202'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\UpdateProductionInstanceDomainResponse( @@ -244,7 +244,7 @@ public function updateDomain(?Operations\UpdateProductionInstanceDomainRequestBo contentType: $contentType, rawResponse: $httpResponse ); - } elseif (in_array($statusCode, [400, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -255,9 +255,9 @@ public function updateDomain(?Operations\UpdateProductionInstanceDomainRequestBo } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/BlocklistIdentifiers.php b/src/BlocklistIdentifiers.php index 9b14bca..e057f8c 100644 --- a/src/BlocklistIdentifiers.php +++ b/src/BlocklistIdentifiers.php @@ -74,11 +74,11 @@ public function list(?Options $options = null): Operations\ListBlocklistIdentifi $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 402 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '402', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -95,7 +95,7 @@ public function list(?Options $options = null): Operations\ListBlocklistIdentifi } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [401, 402])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401', '402'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -106,9 +106,9 @@ public function list(?Options $options = null): Operations\ListBlocklistIdentifi } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/ClerkBackendBuilder.php b/src/ClerkBackendBuilder.php index 2b5d17d..ec670ee 100644 --- a/src/ClerkBackendBuilder.php +++ b/src/ClerkBackendBuilder.php @@ -44,7 +44,7 @@ public function setSecurity(string $bearerAuth): ClerkBackendBuilder $security = new Models\Components\Security( bearerAuth: $bearerAuth ); - $this->sdkConfig->security = $security; + $this->sdkConfig->securitySource = fn () => $security; return $this; } @@ -58,7 +58,7 @@ public function setSecurity(string $bearerAuth): ClerkBackendBuilder */ public function setSecuritySource(\Closure $securitySource): ClerkBackendBuilder { - $this->sdkConfig->securitySource = $securitySource; + $this->sdkConfig->securitySource = fn () => new Models\Components\Security(bearerAuth: $securitySource()); return $this; } diff --git a/src/ClerkBackendRedirectUrls.php b/src/ClerkBackendRedirectUrls.php index d146f25..4e658ca 100644 --- a/src/ClerkBackendRedirectUrls.php +++ b/src/ClerkBackendRedirectUrls.php @@ -79,11 +79,11 @@ public function create(?Operations\CreateRedirectURLRequestBody $request = null, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +100,7 @@ public function create(?Operations\CreateRedirectURLRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -111,9 +111,9 @@ public function create(?Operations\CreateRedirectURLRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -154,11 +154,11 @@ public function delete(string $id, ?Options $options = null): Operations\DeleteR $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -175,7 +175,7 @@ public function delete(string $id, ?Options $options = null): Operations\DeleteR } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -186,9 +186,9 @@ public function delete(string $id, ?Options $options = null): Operations\DeleteR } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -229,11 +229,11 @@ public function get(string $id, ?Options $options = null): Operations\GetRedirec $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -250,7 +250,7 @@ public function get(string $id, ?Options $options = null): Operations\GetRedirec } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -261,9 +261,9 @@ public function get(string $id, ?Options $options = null): Operations\GetRedirec } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Clients.php b/src/Clients.php index 057fff6..62f26aa 100644 --- a/src/Clients.php +++ b/src/Clients.php @@ -78,11 +78,11 @@ public function get(string $clientId, ?Options $options = null): Operations\GetC $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -99,7 +99,7 @@ public function get(string $clientId, ?Options $options = null): Operations\GetC } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -110,9 +110,9 @@ public function get(string $clientId, ?Options $options = null): Operations\GetC } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -162,11 +162,11 @@ public function list(?int $limit = null, ?int $offset = null, ?Options $options $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 410 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '410', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -183,7 +183,7 @@ public function list(?int $limit = null, ?int $offset = null, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 410, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '410', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -194,9 +194,9 @@ public function list(?int $limit = null, ?int $offset = null, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -238,11 +238,11 @@ public function verify(?Operations\VerifyClientRequestBody $request = null, ?Opt $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -259,7 +259,7 @@ public function verify(?Operations\VerifyClientRequestBody $request = null, ?Opt } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -270,9 +270,9 @@ public function verify(?Operations\VerifyClientRequestBody $request = null, ?Opt } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Domains.php b/src/Domains.php index e1a5faa..5090996 100644 --- a/src/Domains.php +++ b/src/Domains.php @@ -83,11 +83,11 @@ public function add(?Operations\AddDomainRequestBody $request = null, ?Options $ $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -104,7 +104,7 @@ public function add(?Operations\AddDomainRequestBody $request = null, ?Options $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -115,9 +115,9 @@ public function add(?Operations\AddDomainRequestBody $request = null, ?Options $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -159,11 +159,11 @@ public function delete(string $domainId, ?Options $options = null): Operations\D $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -180,7 +180,7 @@ public function delete(string $domainId, ?Options $options = null): Operations\D } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -191,9 +191,9 @@ public function delete(string $domainId, ?Options $options = null): Operations\D } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -231,11 +231,11 @@ public function list(?Options $options = null): Operations\ListDomainsResponse $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -252,9 +252,9 @@ public function list(?Options $options = null): Operations\ListDomainsResponse } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -309,11 +309,11 @@ public function update(Operations\UpdateDomainRequestBody $requestBody, string $ $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -330,7 +330,7 @@ public function update(Operations\UpdateDomainRequestBody $requestBody, string $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -341,9 +341,9 @@ public function update(Operations\UpdateDomainRequestBody $requestBody, string $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/EmailAddresses.php b/src/EmailAddresses.php index c8f38a3..e3dba8a 100644 --- a/src/EmailAddresses.php +++ b/src/EmailAddresses.php @@ -79,11 +79,11 @@ public function create(?Operations\CreateEmailAddressRequestBody $request = null $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +100,7 @@ public function create(?Operations\CreateEmailAddressRequestBody $request = null } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -111,9 +111,9 @@ public function create(?Operations\CreateEmailAddressRequestBody $request = null } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -154,11 +154,11 @@ public function delete(string $emailAddressId, ?Options $options = null): Operat $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -175,7 +175,7 @@ public function delete(string $emailAddressId, ?Options $options = null): Operat } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -186,9 +186,9 @@ public function delete(string $emailAddressId, ?Options $options = null): Operat } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -229,11 +229,11 @@ public function get(string $emailAddressId, ?Options $options = null): Operation $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -250,7 +250,7 @@ public function get(string $emailAddressId, ?Options $options = null): Operation } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -261,9 +261,9 @@ public function get(string $emailAddressId, ?Options $options = null): Operation } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -310,11 +310,11 @@ public function update(string $emailAddressId, ?Operations\UpdateEmailAddressReq $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -331,7 +331,7 @@ public function update(string $emailAddressId, ?Operations\UpdateEmailAddressReq } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -342,9 +342,9 @@ public function update(string $emailAddressId, ?Operations\UpdateEmailAddressReq } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/EmailAndSmsTemplates.php b/src/EmailAndSmsTemplates.php index 2232814..f4465c2 100644 --- a/src/EmailAndSmsTemplates.php +++ b/src/EmailAndSmsTemplates.php @@ -88,11 +88,11 @@ public function upsert(Operations\UpsertTemplatePathParamTemplateType $templateT $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 402 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '402', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -109,7 +109,7 @@ public function upsert(Operations\UpsertTemplatePathParamTemplateType $templateT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 402, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '402', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -120,9 +120,9 @@ public function upsert(Operations\UpsertTemplatePathParamTemplateType $templateT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/EmailSMSTemplates.php b/src/EmailSMSTemplates.php index dbd6566..966511f 100644 --- a/src/EmailSMSTemplates.php +++ b/src/EmailSMSTemplates.php @@ -82,11 +82,11 @@ public function get(Operations\PathParamTemplateType $templateType, string $slug $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +103,7 @@ public function get(Operations\PathParamTemplateType $templateType, string $slug } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,9 +114,9 @@ public function get(Operations\PathParamTemplateType $templateType, string $slug } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -160,11 +160,11 @@ public function list(Operations\TemplateType $templateType, ?Options $options = $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -181,7 +181,7 @@ public function list(Operations\TemplateType $templateType, ?Options $options = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -192,9 +192,9 @@ public function list(Operations\TemplateType $templateType, ?Options $options = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -239,11 +239,11 @@ public function revert(Operations\RevertTemplatePathParamTemplateType $templateT $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 402 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '402', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -260,7 +260,7 @@ public function revert(Operations\RevertTemplatePathParamTemplateType $templateT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 402, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '402', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -271,9 +271,9 @@ public function revert(Operations\RevertTemplatePathParamTemplateType $templateT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -326,11 +326,11 @@ public function toggleTemplateDelivery(Operations\ToggleTemplateDeliveryPathPara $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -347,7 +347,7 @@ public function toggleTemplateDelivery(Operations\ToggleTemplateDeliveryPathPara } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -358,9 +358,9 @@ public function toggleTemplateDelivery(Operations\ToggleTemplateDeliveryPathPara } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/InstanceSettings.php b/src/InstanceSettings.php index 3d6e10c..4bb75aa 100644 --- a/src/InstanceSettings.php +++ b/src/InstanceSettings.php @@ -74,11 +74,11 @@ public function getInstance(?Options $options = null): Operations\GetInstanceRes $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -95,9 +95,9 @@ public function getInstance(?Options $options = null): Operations\GetInstanceRes } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -139,11 +139,11 @@ public function update(?Operations\UpdateInstanceRequestBody $request = null, ?O $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\UpdateInstanceResponse( @@ -151,7 +151,7 @@ public function update(?Operations\UpdateInstanceRequestBody $request = null, ?O contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -162,9 +162,9 @@ public function update(?Operations\UpdateInstanceRequestBody $request = null, ?O } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -206,11 +206,11 @@ public function updateOrganizationSettings(?Operations\UpdateInstanceOrganizatio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 402 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -227,7 +227,7 @@ public function updateOrganizationSettings(?Operations\UpdateInstanceOrganizatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 402, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -238,9 +238,9 @@ public function updateOrganizationSettings(?Operations\UpdateInstanceOrganizatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -282,11 +282,11 @@ public function updateRestrictions(?Operations\UpdateInstanceRestrictionsRequest $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -303,7 +303,7 @@ public function updateRestrictions(?Operations\UpdateInstanceRestrictionsRequest } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -314,9 +314,9 @@ public function updateRestrictions(?Operations\UpdateInstanceRestrictionsRequest } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Invitations.php b/src/Invitations.php index 3c5bbef..dc2c0f4 100644 --- a/src/Invitations.php +++ b/src/Invitations.php @@ -82,11 +82,11 @@ public function createBulkInvitations(?array $request = null, ?Options $options $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +103,7 @@ public function createBulkInvitations(?array $request = null, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,9 +114,9 @@ public function createBulkInvitations(?array $request = null, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -160,11 +160,11 @@ public function create(?Operations\CreateInvitationRequestBody $request = null, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -181,7 +181,7 @@ public function create(?Operations\CreateInvitationRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -192,9 +192,9 @@ public function create(?Operations\CreateInvitationRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -244,11 +244,11 @@ public function list(?int $limit = null, ?int $offset = null, ?Operations\ListIn $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -265,9 +265,9 @@ public function list(?int $limit = null, ?int $offset = null, ?Operations\ListIn } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -311,11 +311,11 @@ public function revoke(string $invitationId, ?Options $options = null): Operatio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -332,7 +332,7 @@ public function revoke(string $invitationId, ?Options $options = null): Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -343,9 +343,9 @@ public function revoke(string $invitationId, ?Options $options = null): Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Jwks.php b/src/Jwks.php index b62429b..2a958d5 100644 --- a/src/Jwks.php +++ b/src/Jwks.php @@ -74,11 +74,11 @@ public function get(?Options $options = null): Operations\GetJWKSResponse $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -95,9 +95,9 @@ public function get(?Options $options = null): Operations\GetJWKSResponse } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/JwtTemplates.php b/src/JwtTemplates.php index 56bd723..93ec801 100644 --- a/src/JwtTemplates.php +++ b/src/JwtTemplates.php @@ -79,11 +79,11 @@ public function create(?Operations\CreateJWTTemplateRequestBody $request = null, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +100,7 @@ public function create(?Operations\CreateJWTTemplateRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -111,9 +111,9 @@ public function create(?Operations\CreateJWTTemplateRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -152,11 +152,11 @@ public function delete(string $templateId, ?Options $options = null): Operations $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -173,7 +173,7 @@ public function delete(string $templateId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -184,9 +184,9 @@ public function delete(string $templateId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -227,11 +227,11 @@ public function get(string $templateId, ?Options $options = null): Operations\Ge $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -248,7 +248,7 @@ public function get(string $templateId, ?Options $options = null): Operations\Ge } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -259,9 +259,9 @@ public function get(string $templateId, ?Options $options = null): Operations\Ge } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -296,11 +296,11 @@ public function list(?Options $options = null): Operations\ListJWTTemplatesRespo $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -317,9 +317,9 @@ public function list(?Options $options = null): Operations\ListJWTTemplatesRespo } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -366,11 +366,11 @@ public function update(string $templateId, ?Operations\UpdateJWTTemplateRequestB $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 402 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -387,7 +387,7 @@ public function update(string $templateId, ?Operations\UpdateJWTTemplateRequestB } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 402, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '402', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -398,9 +398,9 @@ public function update(string $templateId, ?Operations\UpdateJWTTemplateRequestB } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Miscellaneous.php b/src/Miscellaneous.php index bc7402f..5b03452 100644 --- a/src/Miscellaneous.php +++ b/src/Miscellaneous.php @@ -83,11 +83,11 @@ public function getInterstitial(?string $frontendApi = null, ?string $publishabl $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\GetPublicInterstitialResponse( @@ -95,9 +95,9 @@ public function getInterstitial(?string $frontendApi = null, ?string $publishabl contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500', '5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Models/Components/ActorToken.php b/src/Models/Components/ActorToken.php index e743cc5..2ab1a3d 100644 --- a/src/Models/Components/ActorToken.php +++ b/src/Models/Components/ActorToken.php @@ -96,6 +96,7 @@ class ActorToken * @param int $updatedAt * @param ?string $token * @param ?string $url + * @phpstan-pure */ public function __construct(ActorTokenObject $object, string $id, ActorTokenStatus $status, string $userId, ActorTokenActor $actor, int $createdAt, int $updatedAt, ?string $token = null, ?string $url = null) { diff --git a/src/Models/Components/Admin.php b/src/Models/Components/Admin.php index a5132a8..c8603ec 100644 --- a/src/Models/Components/Admin.php +++ b/src/Models/Components/Admin.php @@ -48,6 +48,7 @@ class Admin * @param VerificationStrategy $strategy * @param ?int $attempts * @param ?int $expireAt + * @phpstan-pure */ public function __construct(AdminVerificationStatus $status, VerificationStrategy $strategy, ?int $attempts = null, ?int $expireAt = null) { diff --git a/src/Models/Components/AllowlistIdentifier.php b/src/Models/Components/AllowlistIdentifier.php index c511f9a..46c66f5 100644 --- a/src/Models/Components/AllowlistIdentifier.php +++ b/src/Models/Components/AllowlistIdentifier.php @@ -99,6 +99,7 @@ class AllowlistIdentifier * @param ?string $instanceId * @param ?int $createdAt * @param ?int $updatedAt + * @phpstan-pure */ public function __construct(?AllowlistIdentifierObject $object = null, ?string $id = null, ?string $invitationId = null, ?string $identifier = null, ?IdentifierType $identifierType = null, ?string $instanceId = null, ?int $createdAt = null, ?int $updatedAt = null) { diff --git a/src/Models/Components/AttributeMapping.php b/src/Models/Components/AttributeMapping.php index c2318a4..54db96f 100644 --- a/src/Models/Components/AttributeMapping.php +++ b/src/Models/Components/AttributeMapping.php @@ -48,6 +48,7 @@ class AttributeMapping * @param ?string $emailAddress * @param ?string $firstName * @param ?string $lastName + * @phpstan-pure */ public function __construct(?string $userId = null, ?string $emailAddress = null, ?string $firstName = null, ?string $lastName = null) { diff --git a/src/Models/Components/BlocklistIdentifier.php b/src/Models/Components/BlocklistIdentifier.php index 6c3623f..a247441 100644 --- a/src/Models/Components/BlocklistIdentifier.php +++ b/src/Models/Components/BlocklistIdentifier.php @@ -89,6 +89,7 @@ class BlocklistIdentifier * @param ?string $instanceId * @param ?int $createdAt * @param ?int $updatedAt + * @phpstan-pure */ public function __construct(?BlocklistIdentifierObject $object = null, ?string $id = null, ?string $identifier = null, ?BlocklistIdentifierIdentifierType $identifierType = null, ?string $instanceId = null, ?int $createdAt = null, ?int $updatedAt = null) { diff --git a/src/Models/Components/BlocklistIdentifiers.php b/src/Models/Components/BlocklistIdentifiers.php index a33d836..138e2b7 100644 --- a/src/Models/Components/BlocklistIdentifiers.php +++ b/src/Models/Components/BlocklistIdentifiers.php @@ -34,6 +34,7 @@ class BlocklistIdentifiers /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/CNameTarget.php b/src/Models/Components/CNameTarget.php index b9d2659..6c37924 100644 --- a/src/Models/Components/CNameTarget.php +++ b/src/Models/Components/CNameTarget.php @@ -39,6 +39,7 @@ class CNameTarget * @param string $host * @param string $value * @param bool $required + * @phpstan-pure */ public function __construct(string $host, string $value, bool $required) { diff --git a/src/Models/Components/ClerkError.php b/src/Models/Components/ClerkError.php index 406e0bd..6e2e408 100644 --- a/src/Models/Components/ClerkError.php +++ b/src/Models/Components/ClerkError.php @@ -55,6 +55,7 @@ class ClerkError * @param string $code * @param ?Meta $meta * @param ?string $clerkTraceId + * @phpstan-pure */ public function __construct(string $message, string $longMessage, string $code, ?Meta $meta = null, ?string $clerkTraceId = null) { diff --git a/src/Models/Components/Client.php b/src/Models/Components/Client.php index 2e76a6c..40b9aba 100644 --- a/src/Models/Components/Client.php +++ b/src/Models/Components/Client.php @@ -105,6 +105,7 @@ class Client * @param ?string $signInId * @param ?string $signUpId * @param ?string $lastActiveSessionId + * @phpstan-pure */ public function __construct(ObjectT $object, string $id, array $sessionIds, array $sessions, int $updatedAt, int $createdAt, ?string $signInId = null, ?string $signUpId = null, ?string $lastActiveSessionId = null) { diff --git a/src/Models/Components/DeletedObject.php b/src/Models/Components/DeletedObject.php index 9825613..c536750 100644 --- a/src/Models/Components/DeletedObject.php +++ b/src/Models/Components/DeletedObject.php @@ -47,6 +47,7 @@ class DeletedObject * @param bool $deleted * @param ?string $id * @param ?string $slug + * @phpstan-pure */ public function __construct(string $object, bool $deleted, ?string $id = null, ?string $slug = null) { diff --git a/src/Models/Components/Domain.php b/src/Models/Components/Domain.php index eca447f..1784e67 100644 --- a/src/Models/Components/Domain.php +++ b/src/Models/Components/Domain.php @@ -93,6 +93,7 @@ class Domain * @param ?string $accountsPortalUrl * @param ?string $proxyUrl * @param ?array $cnameTargets + * @phpstan-pure */ public function __construct(DomainObject $object, string $id, string $name, bool $isSatellite, string $frontendApiUrl, string $developmentOrigin, ?string $accountsPortalUrl = null, ?string $proxyUrl = null, ?array $cnameTargets = null) { diff --git a/src/Models/Components/Domains.php b/src/Models/Components/Domains.php index 44d7b20..0b0b87e 100644 --- a/src/Models/Components/Domains.php +++ b/src/Models/Components/Domains.php @@ -34,6 +34,7 @@ class Domains /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/EmailAddress.php b/src/Models/Components/EmailAddress.php index 085c70f..4d58091 100644 --- a/src/Models/Components/EmailAddress.php +++ b/src/Models/Components/EmailAddress.php @@ -79,7 +79,7 @@ class EmailAddress * @var Otp|Admin|FromOAuth|null $verification */ #[\Speakeasy\Serializer\Annotation\SerializedName('verification')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Otp|\Clerk\Backend\Models\Components\Admin|\Clerk\Backend\Models\Components\FromOAuth')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Otp|\Clerk\Backend\Models\Components\Admin|\Clerk\Backend\Models\Components\FromOAuth|null')] public Otp|Admin|FromOAuth|null $verification; /** @@ -103,6 +103,7 @@ class EmailAddress * @param ?string $id * @param Otp|Admin|FromOAuth|null $verification * @param ?bool $matchesSsoConnection + * @phpstan-pure */ public function __construct(EmailAddressObject $object, string $emailAddress, bool $reserved, array $linkedTo, int $createdAt, int $updatedAt, ?string $id = null, Otp|Admin|FromOAuth|null $verification = null, ?bool $matchesSsoConnection = null) { diff --git a/src/Models/Components/ErrorClerkError.php b/src/Models/Components/ErrorClerkError.php index 6f5559d..eb0c55a 100644 --- a/src/Models/Components/ErrorClerkError.php +++ b/src/Models/Components/ErrorClerkError.php @@ -55,6 +55,7 @@ class ErrorClerkError * @param string $code * @param ?ErrorMeta $meta * @param ?string $clerkTraceId + * @phpstan-pure */ public function __construct(string $message, string $longMessage, string $code, ?ErrorMeta $meta = null, ?string $clerkTraceId = null) { diff --git a/src/Models/Components/FromOAuth.php b/src/Models/Components/FromOAuth.php index d0671fa..fb44a77 100644 --- a/src/Models/Components/FromOAuth.php +++ b/src/Models/Components/FromOAuth.php @@ -38,7 +38,7 @@ class FromOAuth * @var ?ErrorClerkError $error */ #[\Speakeasy\Serializer\Annotation\SerializedName('error')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\ErrorClerkError')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\ErrorClerkError|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?ErrorClerkError $error = null; @@ -56,6 +56,7 @@ class FromOAuth * @param ?int $expireAt * @param ?ErrorClerkError $error * @param ?int $attempts + * @phpstan-pure */ public function __construct(FromOAuthVerificationStatus $status, string $strategy, ?int $expireAt = null, ?ErrorClerkError $error = null, ?int $attempts = null) { diff --git a/src/Models/Components/IdentificationLink.php b/src/Models/Components/IdentificationLink.php index 15cb877..304e14e 100644 --- a/src/Models/Components/IdentificationLink.php +++ b/src/Models/Components/IdentificationLink.php @@ -13,11 +13,10 @@ class IdentificationLink { /** * - * @var Type $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Type')] - public Type $type; + public string $type; /** * @@ -27,10 +26,11 @@ class IdentificationLink public string $id; /** - * @param Type $type + * @param string $type * @param string $id + * @phpstan-pure */ - public function __construct(Type $type, string $id) + public function __construct(string $type, string $id) { $this->type = $type; $this->id = $id; diff --git a/src/Models/Components/Instance.php b/src/Models/Components/Instance.php index 2f7184e..a1691cc 100644 --- a/src/Models/Components/Instance.php +++ b/src/Models/Components/Instance.php @@ -53,6 +53,7 @@ class Instance * @param ?string $id * @param ?string $environmentType * @param ?array $allowedOrigins + * @phpstan-pure */ public function __construct(?InstanceObject $object = null, ?string $id = null, ?string $environmentType = null, ?array $allowedOrigins = null) { diff --git a/src/Models/Components/InstanceRestrictions.php b/src/Models/Components/InstanceRestrictions.php index 3389fb3..3db7916 100644 --- a/src/Models/Components/InstanceRestrictions.php +++ b/src/Models/Components/InstanceRestrictions.php @@ -60,6 +60,7 @@ class InstanceRestrictions * @param ?bool $blocklist * @param ?bool $blockEmailSubaddresses * @param ?bool $ignoreDotsForGmailAddresses + * @phpstan-pure */ public function __construct(?InstanceRestrictionsObject $object = null, ?bool $allowlist = null, ?bool $blocklist = null, ?bool $blockEmailSubaddresses = null, ?bool $ignoreDotsForGmailAddresses = null) { diff --git a/src/Models/Components/InstanceSettings.php b/src/Models/Components/InstanceSettings.php index 4473c16..95354fe 100644 --- a/src/Models/Components/InstanceSettings.php +++ b/src/Models/Components/InstanceSettings.php @@ -69,6 +69,7 @@ class InstanceSettings * @param ?string $fromEmailAddress * @param ?bool $progressiveSignUp * @param ?bool $enhancedEmailDeliverability + * @phpstan-pure */ public function __construct(?InstanceSettingsObject $object = null, ?string $id = null, ?bool $restrictedToAllowlist = null, ?string $fromEmailAddress = null, ?bool $progressiveSignUp = null, ?bool $enhancedEmailDeliverability = null) { diff --git a/src/Models/Components/Invitation.php b/src/Models/Components/Invitation.php index 2552d05..d59e2ce 100644 --- a/src/Models/Components/Invitation.php +++ b/src/Models/Components/Invitation.php @@ -110,6 +110,7 @@ class Invitation * @param ?bool $revoked * @param ?string $url * @param ?int $expiresAt + * @phpstan-pure */ public function __construct(InvitationObject $object, string $id, string $emailAddress, InvitationStatus $status, int $createdAt, int $updatedAt, ?array $publicMetadata = null, ?bool $revoked = null, ?string $url = null, ?int $expiresAt = null) { diff --git a/src/Models/Components/InvitationRevoked.php b/src/Models/Components/InvitationRevoked.php index f294c94..456287e 100644 --- a/src/Models/Components/InvitationRevoked.php +++ b/src/Models/Components/InvitationRevoked.php @@ -110,6 +110,7 @@ class InvitationRevoked * @param ?bool $revoked * @param ?string $url * @param ?int $expiresAt + * @phpstan-pure */ public function __construct(InvitationRevokedObject $object, string $id, string $emailAddress, InvitationRevokedStatus $status, int $createdAt, int $updatedAt, ?array $publicMetadata = null, ?bool $revoked = null, ?string $url = null, ?int $expiresAt = null) { diff --git a/src/Models/Components/JWTTemplate.php b/src/Models/Components/JWTTemplate.php index a7ee1be..8cedc5c 100644 --- a/src/Models/Components/JWTTemplate.php +++ b/src/Models/Components/JWTTemplate.php @@ -103,6 +103,7 @@ class JWTTemplate * @param int $updatedAt * @param ?bool $customSigningKey * @param ?string $signingAlgorithm + * @phpstan-pure */ public function __construct(JWTTemplateObject $object, string $id, string $name, Claims $claims, int $lifetime, int $allowedClockSkew, int $createdAt, int $updatedAt, ?bool $customSigningKey = null, ?string $signingAlgorithm = null) { diff --git a/src/Models/Components/Jwks.php b/src/Models/Components/Jwks.php index 1368ed4..8bafcf7 100644 --- a/src/Models/Components/Jwks.php +++ b/src/Models/Components/Jwks.php @@ -24,6 +24,7 @@ class Jwks /** * @param ?array $keys + * @phpstan-pure */ public function __construct(?array $keys = null) { diff --git a/src/Models/Components/Keys.php b/src/Models/Components/Keys.php index 1243c4c..8d017f3 100644 --- a/src/Models/Components/Keys.php +++ b/src/Models/Components/Keys.php @@ -84,6 +84,7 @@ class Keys * @param ?string $e * @param ?string $x * @param ?string $crv + * @phpstan-pure */ public function __construct(?string $use = null, ?string $kty = null, ?string $kid = null, ?string $alg = null, ?string $n = null, ?string $e = null, ?string $x = null, ?string $crv = null) { diff --git a/src/Models/Components/LatestActivity.php b/src/Models/Components/LatestActivity.php index 355754f..939d177 100644 --- a/src/Models/Components/LatestActivity.php +++ b/src/Models/Components/LatestActivity.php @@ -91,6 +91,7 @@ class LatestActivity * @param ?string $ipAddress * @param ?string $city * @param ?string $country + * @phpstan-pure */ public function __construct(string $object, string $id, ?string $deviceType = null, ?bool $isMobile = null, ?string $browserName = null, ?string $browserVersion = null, ?string $ipAddress = null, ?string $city = null, ?string $country = null) { diff --git a/src/Models/Components/OAuthApplication.php b/src/Models/Components/OAuthApplication.php index f46f0d3..5567bc9 100644 --- a/src/Models/Components/OAuthApplication.php +++ b/src/Models/Components/OAuthApplication.php @@ -61,9 +61,19 @@ class OAuthApplication #[\Speakeasy\Serializer\Annotation\SerializedName('scopes')] public string $scopes; + /** + * $redirectUris + * + * @var array $redirectUris + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('redirect_uris')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $redirectUris; + /** * * @var string $callbackUrl + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ #[\Speakeasy\Serializer\Annotation\SerializedName('callback_url')] public string $callbackUrl; @@ -131,6 +141,7 @@ class OAuthApplication * @param string $clientId * @param bool $public * @param string $scopes + * @param array $redirectUris * @param string $callbackUrl * @param string $authorizeUrl * @param string $tokenFetchUrl @@ -139,8 +150,9 @@ class OAuthApplication * @param string $tokenIntrospectionUrl * @param int $createdAt * @param int $updatedAt + * @phpstan-pure */ - public function __construct(OAuthApplicationObject $object, string $id, string $instanceId, string $name, string $clientId, bool $public, string $scopes, string $callbackUrl, string $authorizeUrl, string $tokenFetchUrl, string $userInfoUrl, string $discoveryUrl, string $tokenIntrospectionUrl, int $createdAt, int $updatedAt) + public function __construct(OAuthApplicationObject $object, string $id, string $instanceId, string $name, string $clientId, bool $public, string $scopes, array $redirectUris, string $callbackUrl, string $authorizeUrl, string $tokenFetchUrl, string $userInfoUrl, string $discoveryUrl, string $tokenIntrospectionUrl, int $createdAt, int $updatedAt) { $this->object = $object; $this->id = $id; @@ -149,6 +161,7 @@ public function __construct(OAuthApplicationObject $object, string $id, string $ $this->clientId = $clientId; $this->public = $public; $this->scopes = $scopes; + $this->redirectUris = $redirectUris; $this->callbackUrl = $callbackUrl; $this->authorizeUrl = $authorizeUrl; $this->tokenFetchUrl = $tokenFetchUrl; diff --git a/src/Models/Components/OAuthApplicationWithSecret.php b/src/Models/Components/OAuthApplicationWithSecret.php index 3c4b511..d76d1a5 100644 --- a/src/Models/Components/OAuthApplicationWithSecret.php +++ b/src/Models/Components/OAuthApplicationWithSecret.php @@ -61,9 +61,19 @@ class OAuthApplicationWithSecret #[\Speakeasy\Serializer\Annotation\SerializedName('scopes')] public string $scopes; + /** + * $redirectUris + * + * @var array $redirectUris + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('redirect_uris')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $redirectUris; + /** * * @var string $callbackUrl + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ #[\Speakeasy\Serializer\Annotation\SerializedName('callback_url')] public string $callbackUrl; @@ -142,6 +152,7 @@ class OAuthApplicationWithSecret * @param string $clientId * @param bool $public * @param string $scopes + * @param array $redirectUris * @param string $callbackUrl * @param string $authorizeUrl * @param string $tokenFetchUrl @@ -151,8 +162,9 @@ class OAuthApplicationWithSecret * @param int $createdAt * @param int $updatedAt * @param ?string $clientSecret + * @phpstan-pure */ - public function __construct(OAuthApplicationWithSecretObject $object, string $id, string $instanceId, string $name, string $clientId, bool $public, string $scopes, string $callbackUrl, string $authorizeUrl, string $tokenFetchUrl, string $userInfoUrl, string $discoveryUrl, string $tokenIntrospectionUrl, int $createdAt, int $updatedAt, ?string $clientSecret = null) + public function __construct(OAuthApplicationWithSecretObject $object, string $id, string $instanceId, string $name, string $clientId, bool $public, string $scopes, array $redirectUris, string $callbackUrl, string $authorizeUrl, string $tokenFetchUrl, string $userInfoUrl, string $discoveryUrl, string $tokenIntrospectionUrl, int $createdAt, int $updatedAt, ?string $clientSecret = null) { $this->object = $object; $this->id = $id; @@ -161,6 +173,7 @@ public function __construct(OAuthApplicationWithSecretObject $object, string $id $this->clientId = $clientId; $this->public = $public; $this->scopes = $scopes; + $this->redirectUris = $redirectUris; $this->callbackUrl = $callbackUrl; $this->authorizeUrl = $authorizeUrl; $this->tokenFetchUrl = $tokenFetchUrl; diff --git a/src/Models/Components/OAuthApplications.php b/src/Models/Components/OAuthApplications.php index 0b9b7f5..bc8dcab 100644 --- a/src/Models/Components/OAuthApplications.php +++ b/src/Models/Components/OAuthApplications.php @@ -34,6 +34,7 @@ class OAuthApplications /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/Organization.php b/src/Models/Components/Organization.php index f2c9979..c2641c2 100644 --- a/src/Models/Components/Organization.php +++ b/src/Models/Components/Organization.php @@ -122,6 +122,7 @@ class Organization * @param ?bool $adminDeleteEnabled * @param ?int $membersCount * @param ?string $createdBy + * @phpstan-pure */ public function __construct(OrganizationObject $object, string $id, string $name, string $slug, int $maxAllowedMemberships, array $publicMetadata, array $privateMetadata, int $createdAt, int $updatedAt, ?bool $adminDeleteEnabled = null, ?int $membersCount = null, ?string $createdBy = null) { diff --git a/src/Models/Components/OrganizationDomain.php b/src/Models/Components/OrganizationDomain.php index ae3b67e..d913c0d 100644 --- a/src/Models/Components/OrganizationDomain.php +++ b/src/Models/Components/OrganizationDomain.php @@ -128,6 +128,7 @@ class OrganizationDomain * @param ?int $updatedAt * @param ?string $affiliationEmailAddress * @param ?OrganizationDomainVerification $verification + * @phpstan-pure */ public function __construct(?string $id = null, ?OrganizationDomainObject $object = null, ?string $organizationId = null, ?string $name = null, ?EnrollmentMode $enrollmentMode = null, ?int $totalPendingInvitations = null, ?int $totalPendingSuggestions = null, ?int $createdAt = null, ?int $updatedAt = null, ?string $affiliationEmailAddress = null, ?OrganizationDomainVerification $verification = null) { diff --git a/src/Models/Components/OrganizationDomainVerification.php b/src/Models/Components/OrganizationDomainVerification.php index 37bb0b3..cd41235 100644 --- a/src/Models/Components/OrganizationDomainVerification.php +++ b/src/Models/Components/OrganizationDomainVerification.php @@ -54,6 +54,7 @@ class OrganizationDomainVerification * @param ?string $strategy * @param ?int $attempts * @param ?int $expireAt + * @phpstan-pure */ public function __construct(?OrganizationDomainStatus $status = null, ?string $strategy = null, ?int $attempts = null, ?int $expireAt = null) { diff --git a/src/Models/Components/OrganizationDomains.php b/src/Models/Components/OrganizationDomains.php index e7d2e81..ce09bca 100644 --- a/src/Models/Components/OrganizationDomains.php +++ b/src/Models/Components/OrganizationDomains.php @@ -34,6 +34,7 @@ class OrganizationDomains /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/OrganizationInvitation.php b/src/Models/Components/OrganizationInvitation.php index fc8ff27..ff94e0c 100644 --- a/src/Models/Components/OrganizationInvitation.php +++ b/src/Models/Components/OrganizationInvitation.php @@ -143,6 +143,7 @@ class OrganizationInvitation * @param ?int $updatedAt * @param ?string $url * @param ?int $expiresAt + * @phpstan-pure */ public function __construct(?string $id = null, ?OrganizationInvitationObject $object = null, ?string $emailAddress = null, ?string $role = null, ?string $roleName = null, ?string $organizationId = null, ?string $status = null, ?array $publicMetadata = null, ?array $privateMetadata = null, ?int $createdAt = null, ?int $updatedAt = null, ?string $url = null, ?int $expiresAt = null) { diff --git a/src/Models/Components/OrganizationInvitationWithPublicOrganizationData.php b/src/Models/Components/OrganizationInvitationWithPublicOrganizationData.php index a00e3db..dd6f65d 100644 --- a/src/Models/Components/OrganizationInvitationWithPublicOrganizationData.php +++ b/src/Models/Components/OrganizationInvitationWithPublicOrganizationData.php @@ -141,6 +141,7 @@ class OrganizationInvitationWithPublicOrganizationData * @param ?int $createdAt * @param ?int $updatedAt * @param ?string $url + * @phpstan-pure */ public function __construct(?string $id = null, ?OrganizationInvitationWithPublicOrganizationDataObject $object = null, ?string $emailAddress = null, ?string $role = null, ?string $roleName = null, ?string $organizationId = null, ?string $status = null, ?array $publicMetadata = null, ?array $privateMetadata = null, ?PublicOrganizationData $publicOrganizationData = null, ?int $createdAt = null, ?int $updatedAt = null, ?string $url = null) { diff --git a/src/Models/Components/OrganizationInvitations.php b/src/Models/Components/OrganizationInvitations.php index 6bd3581..63960bb 100644 --- a/src/Models/Components/OrganizationInvitations.php +++ b/src/Models/Components/OrganizationInvitations.php @@ -34,6 +34,7 @@ class OrganizationInvitations /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/OrganizationInvitationsWithPublicOrganizationData.php b/src/Models/Components/OrganizationInvitationsWithPublicOrganizationData.php index 3551f19..22c8be0 100644 --- a/src/Models/Components/OrganizationInvitationsWithPublicOrganizationData.php +++ b/src/Models/Components/OrganizationInvitationsWithPublicOrganizationData.php @@ -34,6 +34,7 @@ class OrganizationInvitationsWithPublicOrganizationData /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/OrganizationMembership.php b/src/Models/Components/OrganizationMembership.php index ef32a3e..f2dc63d 100644 --- a/src/Models/Components/OrganizationMembership.php +++ b/src/Models/Components/OrganizationMembership.php @@ -126,6 +126,7 @@ class OrganizationMembership * @param ?PublicUserData $publicUserData * @param ?int $createdAt * @param ?int $updatedAt + * @phpstan-pure */ public function __construct(?string $id = null, ?OrganizationMembershipObject $object = null, ?string $role = null, ?string $roleName = null, ?array $permissions = null, ?array $publicMetadata = null, ?array $privateMetadata = null, ?OrganizationMembershipOrganization $organization = null, ?PublicUserData $publicUserData = null, ?int $createdAt = null, ?int $updatedAt = null) { diff --git a/src/Models/Components/OrganizationMembershipOrganization.php b/src/Models/Components/OrganizationMembershipOrganization.php index 1db51fa..49f0abd 100644 --- a/src/Models/Components/OrganizationMembershipOrganization.php +++ b/src/Models/Components/OrganizationMembershipOrganization.php @@ -122,6 +122,7 @@ class OrganizationMembershipOrganization * @param ?bool $adminDeleteEnabled * @param ?int $membersCount * @param ?string $createdBy + * @phpstan-pure */ public function __construct(OrganizationMembershipOrganizationObject $object, string $id, string $name, string $slug, int $maxAllowedMemberships, array $publicMetadata, array $privateMetadata, int $createdAt, int $updatedAt, ?bool $adminDeleteEnabled = null, ?int $membersCount = null, ?string $createdBy = null) { diff --git a/src/Models/Components/OrganizationMemberships.php b/src/Models/Components/OrganizationMemberships.php index fe662f3..9887119 100644 --- a/src/Models/Components/OrganizationMemberships.php +++ b/src/Models/Components/OrganizationMemberships.php @@ -34,6 +34,7 @@ class OrganizationMemberships /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/OrganizationSettings.php b/src/Models/Components/OrganizationSettings.php index 8b06bbd..4cdcec0 100644 --- a/src/Models/Components/OrganizationSettings.php +++ b/src/Models/Components/OrganizationSettings.php @@ -102,6 +102,7 @@ class OrganizationSettings * @param string $domainsDefaultRole * @param ?int $maxAllowedRoles * @param ?int $maxAllowedPermissions + * @phpstan-pure */ public function __construct(OrganizationSettingsObject $object, bool $enabled, int $maxAllowedMemberships, string $creatorRole, bool $adminDeleteEnabled, bool $domainsEnabled, array $domainsEnrollmentModes, string $domainsDefaultRole, ?int $maxAllowedRoles = null, ?int $maxAllowedPermissions = null) { diff --git a/src/Models/Components/OrganizationWithLogo.php b/src/Models/Components/OrganizationWithLogo.php index a233290..1323b57 100644 --- a/src/Models/Components/OrganizationWithLogo.php +++ b/src/Models/Components/OrganizationWithLogo.php @@ -149,6 +149,7 @@ class OrganizationWithLogo * @param ?bool $hasImage * @param ?int $membersCount * @param ?string $createdBy + * @phpstan-pure */ public function __construct(OrganizationWithLogoObject $object, string $id, string $name, string $slug, int $maxAllowedMemberships, array $publicMetadata, array $privateMetadata, int $createdAt, int $updatedAt, string $imageUrl, ?bool $adminDeleteEnabled = null, ?string $logoUrl = null, ?bool $hasImage = null, ?int $membersCount = null, ?string $createdBy = null) { diff --git a/src/Models/Components/Organizations.php b/src/Models/Components/Organizations.php index aed2f9d..c20ca23 100644 --- a/src/Models/Components/Organizations.php +++ b/src/Models/Components/Organizations.php @@ -34,6 +34,7 @@ class Organizations /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/Otp.php b/src/Models/Components/Otp.php index 12acfdf..e0ded5c 100644 --- a/src/Models/Components/Otp.php +++ b/src/Models/Components/Otp.php @@ -46,6 +46,7 @@ class Otp * @param Strategy $strategy * @param int $attempts * @param int $expireAt + * @phpstan-pure */ public function __construct(VerificationStatus $status, Strategy $strategy, int $attempts, int $expireAt) { diff --git a/src/Models/Components/Passkey.php b/src/Models/Components/Passkey.php index 7978261..629f82c 100644 --- a/src/Models/Components/Passkey.php +++ b/src/Models/Components/Passkey.php @@ -58,6 +58,7 @@ class Passkey * @param ?Nonce $nonce * @param ?int $attempts * @param ?int $expireAt + * @phpstan-pure */ public function __construct(PasskeyVerificationStatus $status, PasskeyVerificationStrategy $strategy, ?Nonce $nonce = null, ?int $attempts = null, ?int $expireAt = null) { diff --git a/src/Models/Components/PhoneNumber.php b/src/Models/Components/PhoneNumber.php index 6790783..9bdf24a 100644 --- a/src/Models/Components/PhoneNumber.php +++ b/src/Models/Components/PhoneNumber.php @@ -95,7 +95,7 @@ class PhoneNumber * @var VerificationOTP|VerificationAdmin|null $verification */ #[\Speakeasy\Serializer\Annotation\SerializedName('verification')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\VerificationOTP|\Clerk\Backend\Models\Components\VerificationAdmin')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\VerificationOTP|\Clerk\Backend\Models\Components\VerificationAdmin|null')] public VerificationOTP|VerificationAdmin|null $verification; /** @@ -120,6 +120,7 @@ class PhoneNumber * @param ?bool $defaultSecondFactor * @param VerificationOTP|VerificationAdmin|null $verification * @param ?array $backupCodes + * @phpstan-pure */ public function __construct(PhoneNumberObject $object, string $phoneNumber, bool $reserved, array $linkedTo, int $createdAt, int $updatedAt, ?string $id = null, ?bool $reservedForSecondFactor = null, ?bool $defaultSecondFactor = null, VerificationOTP|VerificationAdmin|null $verification = null, ?array $backupCodes = null) { diff --git a/src/Models/Components/ProxyCheck.php b/src/Models/Components/ProxyCheck.php index 0a6d3d4..c5e1510 100644 --- a/src/Models/Components/ProxyCheck.php +++ b/src/Models/Components/ProxyCheck.php @@ -78,6 +78,7 @@ class ProxyCheck * @param bool $successful * @param int $createdAt * @param int $updatedAt + * @phpstan-pure */ public function __construct(ProxyCheckObject $object, string $id, string $domainId, int $lastRunAt, string $proxyUrl, bool $successful, int $createdAt, int $updatedAt) { diff --git a/src/Models/Components/PublicOrganizationData.php b/src/Models/Components/PublicOrganizationData.php index 3f4bc16..c5c71d7 100644 --- a/src/Models/Components/PublicOrganizationData.php +++ b/src/Models/Components/PublicOrganizationData.php @@ -57,6 +57,7 @@ class PublicOrganizationData * @param ?string $slug * @param ?string $imageUrl * @param ?bool $hasImage + * @phpstan-pure */ public function __construct(?string $id = null, ?string $name = null, ?string $slug = null, ?string $imageUrl = null, ?bool $hasImage = null) { diff --git a/src/Models/Components/PublicUserData.php b/src/Models/Components/PublicUserData.php index 566d419..510b3e4 100644 --- a/src/Models/Components/PublicUserData.php +++ b/src/Models/Components/PublicUserData.php @@ -76,6 +76,7 @@ class PublicUserData * @param ?string $lastName * @param ?string $profileImageUrl * @param ?string $identifier + * @phpstan-pure */ public function __construct(?string $userId = null, ?string $imageUrl = null, ?bool $hasImage = null, ?string $firstName = null, ?string $lastName = null, ?string $profileImageUrl = null, ?string $identifier = null) { diff --git a/src/Models/Components/RedirectURL.php b/src/Models/Components/RedirectURL.php index 4315905..e3c26ef 100644 --- a/src/Models/Components/RedirectURL.php +++ b/src/Models/Components/RedirectURL.php @@ -60,6 +60,7 @@ class RedirectURL * @param string $url * @param int $createdAt * @param int $updatedAt + * @phpstan-pure */ public function __construct(RedirectURLObject $object, string $id, string $url, int $createdAt, int $updatedAt) { diff --git a/src/Models/Components/SAMLAccount.php b/src/Models/Components/SAMLAccount.php index 23d9286..611e02e 100644 --- a/src/Models/Components/SAMLAccount.php +++ b/src/Models/Components/SAMLAccount.php @@ -65,7 +65,7 @@ class SAMLAccount * @var Saml|Ticket|null $verification */ #[\Speakeasy\Serializer\Annotation\SerializedName('verification')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Saml|\Clerk\Backend\Models\Components\Ticket')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Saml|\Clerk\Backend\Models\Components\Ticket|null')] public Saml|Ticket|null $verification; /** @@ -97,7 +97,7 @@ class SAMLAccount * @var ?SAMLConnectionSAMLConnection $samlConnection */ #[\Speakeasy\Serializer\Annotation\SerializedName('saml_connection')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\SAMLConnectionSAMLConnection')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\SAMLConnectionSAMLConnection|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?SAMLConnectionSAMLConnection $samlConnection = null; @@ -113,6 +113,7 @@ class SAMLAccount * @param ?string $lastName * @param ?string $providerUserId * @param ?SAMLConnectionSAMLConnection $samlConnection + * @phpstan-pure */ public function __construct(string $id, SAMLAccountObject $object, string $provider, bool $active, string $emailAddress, ?array $publicMetadata = null, Saml|Ticket|null $verification = null, ?string $firstName = null, ?string $lastName = null, ?string $providerUserId = null, ?SAMLConnectionSAMLConnection $samlConnection = null) { diff --git a/src/Models/Components/SAMLConnectionSAMLConnection.php b/src/Models/Components/SAMLConnectionSAMLConnection.php index 5f10659..57128f1 100644 --- a/src/Models/Components/SAMLConnectionSAMLConnection.php +++ b/src/Models/Components/SAMLConnectionSAMLConnection.php @@ -109,6 +109,7 @@ class SAMLConnectionSAMLConnection * @param ?bool $allowSubdomains * @param ?bool $allowIdpInitiated * @param ?bool $disableAdditionalIdentifications + * @phpstan-pure */ public function __construct(string $id, string $name, string $domain, bool $active, string $provider, bool $syncUserAttributes, int $createdAt, int $updatedAt, ?bool $allowSubdomains = null, ?bool $allowIdpInitiated = null, ?bool $disableAdditionalIdentifications = null) { diff --git a/src/Models/Components/SAMLConnections.php b/src/Models/Components/SAMLConnections.php index 93d6a6c..bff65a4 100644 --- a/src/Models/Components/SAMLConnections.php +++ b/src/Models/Components/SAMLConnections.php @@ -34,6 +34,7 @@ class SAMLConnections /** * @param array $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/SAMLErrorClerkError.php b/src/Models/Components/SAMLErrorClerkError.php index 396f1f0..4cefd92 100644 --- a/src/Models/Components/SAMLErrorClerkError.php +++ b/src/Models/Components/SAMLErrorClerkError.php @@ -55,6 +55,7 @@ class SAMLErrorClerkError * @param string $code * @param ?ClerkErrorErrorMeta $meta * @param ?string $clerkTraceId + * @phpstan-pure */ public function __construct(string $message, string $longMessage, string $code, ?ClerkErrorErrorMeta $meta = null, ?string $clerkTraceId = null) { diff --git a/src/Models/Components/Saml.php b/src/Models/Components/Saml.php index c3dc073..3f7cf7c 100644 --- a/src/Models/Components/Saml.php +++ b/src/Models/Components/Saml.php @@ -46,7 +46,7 @@ class Saml * @var ?SAMLErrorClerkError $error */ #[\Speakeasy\Serializer\Annotation\SerializedName('error')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\SAMLErrorClerkError')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\SAMLErrorClerkError|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?SAMLErrorClerkError $error = null; @@ -65,6 +65,7 @@ class Saml * @param ?string $externalVerificationRedirectUrl * @param ?SAMLErrorClerkError $error * @param ?int $attempts + * @phpstan-pure */ public function __construct(SAMLVerificationStatus $status, SAMLVerificationStrategy $strategy, int $expireAt, ?string $externalVerificationRedirectUrl = null, ?SAMLErrorClerkError $error = null, ?int $attempts = null) { diff --git a/src/Models/Components/SchemasPasskey.php b/src/Models/Components/SchemasPasskey.php index 299d41e..27a4e85 100644 --- a/src/Models/Components/SchemasPasskey.php +++ b/src/Models/Components/SchemasPasskey.php @@ -52,7 +52,7 @@ class SchemasPasskey * @var ?Passkey $verification */ #[\Speakeasy\Serializer\Annotation\SerializedName('verification')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Passkey')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Passkey|null')] public ?Passkey $verification; /** @@ -61,6 +61,7 @@ class SchemasPasskey * @param int $lastUsedAt * @param ?string $id * @param ?Passkey $verification + * @phpstan-pure */ public function __construct(SchemasPasskeyObject $object, string $name, int $lastUsedAt, ?string $id = null, ?Passkey $verification = null) { diff --git a/src/Models/Components/SchemasSAMLConnection.php b/src/Models/Components/SchemasSAMLConnection.php index 78d26b7..989e394 100644 --- a/src/Models/Components/SchemasSAMLConnection.php +++ b/src/Models/Components/SchemasSAMLConnection.php @@ -211,6 +211,7 @@ class SchemasSAMLConnection * @param ?string $idpMetadataUrl * @param ?string $idpMetadata * @param ?string $organizationId + * @phpstan-pure */ public function __construct(SchemasSAMLConnectionObject $object, string $id, string $name, string $domain, string $acsUrl, string $spEntityId, string $spMetadataUrl, bool $active, string $provider, int $userCount, bool $syncUserAttributes, int $createdAt, int $updatedAt, ?string $idpEntityId = null, ?string $idpSsoUrl = null, ?string $idpCertificate = null, ?AttributeMapping $attributeMapping = null, ?bool $allowSubdomains = null, ?bool $allowIdpInitiated = null, ?bool $disableAdditionalIdentifications = null, ?string $idpMetadataUrl = null, ?string $idpMetadata = null, ?string $organizationId = null) { diff --git a/src/Models/Components/Security.php b/src/Models/Components/Security.php index 5923b06..34e486e 100644 --- a/src/Models/Components/Security.php +++ b/src/Models/Components/Security.php @@ -20,6 +20,7 @@ class Security /** * @param ?string $bearerAuth + * @phpstan-pure */ public function __construct(?string $bearerAuth = null) { diff --git a/src/Models/Components/Session.php b/src/Models/Components/Session.php index eb3ebbb..9eba959 100644 --- a/src/Models/Components/Session.php +++ b/src/Models/Components/Session.php @@ -132,6 +132,7 @@ class Session * @param ?Actor $actor * @param ?string $lastActiveOrganizationId * @param ?LatestActivity $latestActivity + * @phpstan-pure */ public function __construct(SessionObject $object, string $id, string $userId, string $clientId, Status $status, int $lastActiveAt, int $expireAt, int $abandonAt, int $updatedAt, int $createdAt, ?Actor $actor = null, ?string $lastActiveOrganizationId = null, ?LatestActivity $latestActivity = null) { diff --git a/src/Models/Components/SignInToken.php b/src/Models/Components/SignInToken.php index 6753feb..c9725dc 100644 --- a/src/Models/Components/SignInToken.php +++ b/src/Models/Components/SignInToken.php @@ -87,6 +87,7 @@ class SignInToken * @param int $updatedAt * @param ?string $token * @param ?string $url + * @phpstan-pure */ public function __construct(SignInTokenObject $object, string $id, SignInTokenStatus $status, string $userId, int $createdAt, int $updatedAt, ?string $token = null, ?string $url = null) { diff --git a/src/Models/Components/SignUp.php b/src/Models/Components/SignUp.php index 71040e1..d38dffb 100644 --- a/src/Models/Components/SignUp.php +++ b/src/Models/Components/SignUp.php @@ -242,6 +242,7 @@ class SignUp * @param ?string $createdSessionId * @param ?string $createdUserId * @param ?int $legalAcceptedAt + * @phpstan-pure */ public function __construct(SignUpObject $object, string $id, SignUpStatus $status, bool $passwordEnabled, bool $customAction, int $abandonAt, ?array $requiredFields = null, ?array $optionalFields = null, ?array $missingFields = null, ?array $unverifiedFields = null, ?Verifications $verifications = null, ?array $unsafeMetadata = null, ?array $publicMetadata = null, ?ExternalAccount $externalAccount = null, ?string $username = null, ?string $emailAddress = null, ?string $phoneNumber = null, ?string $web3Wallet = null, ?string $firstName = null, ?string $lastName = null, ?string $externalId = null, ?string $createdSessionId = null, ?string $createdUserId = null, ?int $legalAcceptedAt = null) { diff --git a/src/Models/Components/SvixURL.php b/src/Models/Components/SvixURL.php index b71a2a8..98a26d3 100644 --- a/src/Models/Components/SvixURL.php +++ b/src/Models/Components/SvixURL.php @@ -21,6 +21,7 @@ class SvixURL /** * @param string $svixUrl + * @phpstan-pure */ public function __construct(string $svixUrl) { diff --git a/src/Models/Components/Template.php b/src/Models/Components/Template.php index 84a478d..c9c458c 100644 --- a/src/Models/Components/Template.php +++ b/src/Models/Components/Template.php @@ -237,6 +237,7 @@ class Template * @param ?int $createdAt * @param ?string $instanceId * @param ?string $subject + * @phpstan-pure */ public function __construct(?string $id = null, ?TemplateObject $object = null, ?string $resourceType = null, ?string $templateType = null, ?string $name = null, ?string $slug = null, ?int $position = null, ?bool $canRevert = null, ?bool $canDelete = null, ?bool $canToggle = null, ?string $markup = null, ?string $body = null, ?array $availableVariables = null, ?array $requiredVariables = null, ?string $fromEmailName = null, ?string $replyToEmailName = null, ?bool $deliveredByClerk = null, ?bool $enabled = null, ?int $updatedAt = null, ?int $createdAt = null, ?string $instanceId = null, ?string $subject = null) { diff --git a/src/Models/Components/TestingToken.php b/src/Models/Components/TestingToken.php index aa9bdef..3c38292 100644 --- a/src/Models/Components/TestingToken.php +++ b/src/Models/Components/TestingToken.php @@ -42,6 +42,7 @@ class TestingToken * @param TestingTokenObject $object * @param string $token * @param int $expiresAt + * @phpstan-pure */ public function __construct(TestingTokenObject $object, string $token, int $expiresAt) { diff --git a/src/Models/Components/Ticket.php b/src/Models/Components/Ticket.php index 25bc00e..c57c994 100644 --- a/src/Models/Components/Ticket.php +++ b/src/Models/Components/Ticket.php @@ -48,6 +48,7 @@ class Ticket * @param TicketVerificationStrategy $strategy * @param ?int $attempts * @param ?int $expireAt + * @phpstan-pure */ public function __construct(TicketVerificationStatus $status, TicketVerificationStrategy $strategy, ?int $attempts = null, ?int $expireAt = null) { diff --git a/src/Models/Components/TotalCount.php b/src/Models/Components/TotalCount.php index 7a89594..9996a48 100644 --- a/src/Models/Components/TotalCount.php +++ b/src/Models/Components/TotalCount.php @@ -33,6 +33,7 @@ class TotalCount /** * @param TotalCountObject $object * @param int $totalCount + * @phpstan-pure */ public function __construct(TotalCountObject $object, int $totalCount) { diff --git a/src/Models/Components/Type.php b/src/Models/Components/Type.php deleted file mode 100644 index 5eea881..0000000 --- a/src/Models/Components/Type.php +++ /dev/null @@ -1,21 +0,0 @@ - $data * @param int $totalCount + * @phpstan-pure */ public function __construct(array $data, int $totalCount) { diff --git a/src/Models/Components/WaitlistEntry.php b/src/Models/Components/WaitlistEntry.php index 5be0b4c..d710ec2 100644 --- a/src/Models/Components/WaitlistEntry.php +++ b/src/Models/Components/WaitlistEntry.php @@ -90,6 +90,7 @@ class WaitlistEntry * @param int $updatedAt * @param ?bool $isLocked * @param ?WaitlistEntryInvitation $invitation + * @phpstan-pure */ public function __construct(WaitlistEntryObject $object, string $id, string $emailAddress, WaitlistEntryStatus $status, int $createdAt, int $updatedAt, ?bool $isLocked = null, ?WaitlistEntryInvitation $invitation = null) { diff --git a/src/Models/Components/WaitlistEntryInvitation.php b/src/Models/Components/WaitlistEntryInvitation.php index 9c612ca..bd252c1 100644 --- a/src/Models/Components/WaitlistEntryInvitation.php +++ b/src/Models/Components/WaitlistEntryInvitation.php @@ -109,6 +109,7 @@ class WaitlistEntryInvitation * @param ?bool $revoked * @param ?string $url * @param ?int $expiresAt + * @phpstan-pure */ public function __construct(WaitlistEntryInvitationObject $object, string $id, string $emailAddress, WaitlistEntryInvitationStatus $status, int $createdAt, int $updatedAt, ?array $publicMetadata = null, ?bool $revoked = null, ?string $url = null, ?int $expiresAt = null) { diff --git a/src/Models/Components/Web3Signature.php b/src/Models/Components/Web3Signature.php index b290628..6b8ebcc 100644 --- a/src/Models/Components/Web3Signature.php +++ b/src/Models/Components/Web3Signature.php @@ -66,6 +66,7 @@ class Web3Signature * @param ?string $message * @param ?int $attempts * @param ?int $expireAt + * @phpstan-pure */ public function __construct(Web3SignatureVerificationStatus $status, Web3SignatureVerificationStrategy $strategy, ?string $nonce = null, ?string $message = null, ?int $attempts = null, ?int $expireAt = null) { diff --git a/src/Models/Components/Web3Wallet.php b/src/Models/Components/Web3Wallet.php index 99f8e7e..6dd6227 100644 --- a/src/Models/Components/Web3Wallet.php +++ b/src/Models/Components/Web3Wallet.php @@ -62,7 +62,7 @@ class Web3Wallet * @var Web3Signature|Web3WalletVerificationAdmin|null $verification */ #[\Speakeasy\Serializer\Annotation\SerializedName('verification')] - #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Web3Signature|\Clerk\Backend\Models\Components\Web3WalletVerificationAdmin')] + #[\Speakeasy\Serializer\Annotation\Type('\Clerk\Backend\Models\Components\Web3Signature|\Clerk\Backend\Models\Components\Web3WalletVerificationAdmin|null')] public Web3Signature|Web3WalletVerificationAdmin|null $verification; /** @@ -72,6 +72,7 @@ class Web3Wallet * @param int $updatedAt * @param ?string $id * @param Web3Signature|Web3WalletVerificationAdmin|null $verification + * @phpstan-pure */ public function __construct(Web3WalletObject $object, string $web3Wallet, int $createdAt, int $updatedAt, ?string $id = null, Web3Signature|Web3WalletVerificationAdmin|null $verification = null) { diff --git a/src/Models/Components/Web3WalletVerificationAdmin.php b/src/Models/Components/Web3WalletVerificationAdmin.php index 0f4c0ca..762fff1 100644 --- a/src/Models/Components/Web3WalletVerificationAdmin.php +++ b/src/Models/Components/Web3WalletVerificationAdmin.php @@ -48,6 +48,7 @@ class Web3WalletVerificationAdmin * @param AdminVerificationWeb3WalletStrategy $strategy * @param ?int $attempts * @param ?int $expireAt + * @phpstan-pure */ public function __construct(AdminVerificationWeb3WalletStatus $status, AdminVerificationWeb3WalletStrategy $strategy, ?int $attempts = null, ?int $expireAt = null) { diff --git a/src/Models/Errors/ClerkErrors.php b/src/Models/Errors/ClerkErrors.php index fb5907a..7e73b44 100644 --- a/src/Models/Errors/ClerkErrors.php +++ b/src/Models/Errors/ClerkErrors.php @@ -34,6 +34,7 @@ class ClerkErrors /** * @param array $errors * @param ?Meta $meta + * @phpstan-pure */ public function __construct(array $errors, ?Meta $meta = null) { diff --git a/src/Models/Operations/AddDomainRequestBody.php b/src/Models/Operations/AddDomainRequestBody.php index 7ce9e24..aaee2bf 100644 --- a/src/Models/Operations/AddDomainRequestBody.php +++ b/src/Models/Operations/AddDomainRequestBody.php @@ -40,6 +40,7 @@ class AddDomainRequestBody * @param string $name * @param bool $isSatellite * @param ?string $proxyUrl + * @phpstan-pure */ public function __construct(string $name, bool $isSatellite, ?string $proxyUrl = null) { diff --git a/src/Models/Operations/AddDomainResponse.php b/src/Models/Operations/AddDomainResponse.php index e3fcd83..a0112e9 100644 --- a/src/Models/Operations/AddDomainResponse.php +++ b/src/Models/Operations/AddDomainResponse.php @@ -44,6 +44,7 @@ class AddDomainResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Domain $domain + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Domain $domain = null) { diff --git a/src/Models/Operations/AttributeMapping.php b/src/Models/Operations/AttributeMapping.php index 0711726..72b9a6b 100644 --- a/src/Models/Operations/AttributeMapping.php +++ b/src/Models/Operations/AttributeMapping.php @@ -49,6 +49,7 @@ class AttributeMapping * @param ?string $emailAddress * @param ?string $firstName * @param ?string $lastName + * @phpstan-pure */ public function __construct(?string $userId = null, ?string $emailAddress = null, ?string $firstName = null, ?string $lastName = null) { diff --git a/src/Models/Operations/BanUserRequest.php b/src/Models/Operations/BanUserRequest.php index ff76e83..9375fe6 100644 --- a/src/Models/Operations/BanUserRequest.php +++ b/src/Models/Operations/BanUserRequest.php @@ -21,6 +21,7 @@ class BanUserRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/BanUserResponse.php b/src/Models/Operations/BanUserResponse.php index e58cb1e..d7d10a5 100644 --- a/src/Models/Operations/BanUserResponse.php +++ b/src/Models/Operations/BanUserResponse.php @@ -44,6 +44,7 @@ class BanUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/ChangeProductionInstanceDomainRequestBody.php b/src/Models/Operations/ChangeProductionInstanceDomainRequestBody.php index 3448453..bfc8a15 100644 --- a/src/Models/Operations/ChangeProductionInstanceDomainRequestBody.php +++ b/src/Models/Operations/ChangeProductionInstanceDomainRequestBody.php @@ -35,6 +35,7 @@ class ChangeProductionInstanceDomainRequestBody /** * @param ?string $homeUrl * @param ?bool $isSecondary + * @phpstan-pure */ public function __construct(?string $homeUrl = null, ?bool $isSecondary = null) { diff --git a/src/Models/Operations/ChangeProductionInstanceDomainResponse.php b/src/Models/Operations/ChangeProductionInstanceDomainResponse.php index 2faac3c..60d34bf 100644 --- a/src/Models/Operations/ChangeProductionInstanceDomainResponse.php +++ b/src/Models/Operations/ChangeProductionInstanceDomainResponse.php @@ -36,6 +36,7 @@ class ChangeProductionInstanceDomainResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/CreateActorTokenRequestBody.php b/src/Models/Operations/CreateActorTokenRequestBody.php index 693ab29..9fcc098 100644 --- a/src/Models/Operations/CreateActorTokenRequestBody.php +++ b/src/Models/Operations/CreateActorTokenRequestBody.php @@ -57,6 +57,7 @@ class CreateActorTokenRequestBody * @param Actor $actor * @param ?int $expiresInSeconds * @param ?int $sessionMaxDurationInSeconds + * @phpstan-pure */ public function __construct(string $userId, Actor $actor, ?int $expiresInSeconds = 3600, ?int $sessionMaxDurationInSeconds = 1800) { diff --git a/src/Models/Operations/CreateActorTokenResponse.php b/src/Models/Operations/CreateActorTokenResponse.php index 31c47e7..dde1956 100644 --- a/src/Models/Operations/CreateActorTokenResponse.php +++ b/src/Models/Operations/CreateActorTokenResponse.php @@ -44,6 +44,7 @@ class CreateActorTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ActorToken $actorToken + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ActorToken $actorToken = null) { diff --git a/src/Models/Operations/CreateAllowlistIdentifierRequestBody.php b/src/Models/Operations/CreateAllowlistIdentifierRequestBody.php index d93f2fc..9f98294 100644 --- a/src/Models/Operations/CreateAllowlistIdentifierRequestBody.php +++ b/src/Models/Operations/CreateAllowlistIdentifierRequestBody.php @@ -35,6 +35,7 @@ class CreateAllowlistIdentifierRequestBody /** * @param string $identifier * @param ?bool $notify + * @phpstan-pure */ public function __construct(string $identifier, ?bool $notify = false) { diff --git a/src/Models/Operations/CreateAllowlistIdentifierResponse.php b/src/Models/Operations/CreateAllowlistIdentifierResponse.php index e1751a7..66289f3 100644 --- a/src/Models/Operations/CreateAllowlistIdentifierResponse.php +++ b/src/Models/Operations/CreateAllowlistIdentifierResponse.php @@ -44,6 +44,7 @@ class CreateAllowlistIdentifierResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\AllowlistIdentifier $allowlistIdentifier + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\AllowlistIdentifier $allowlistIdentifier = null) { diff --git a/src/Models/Operations/CreateBlocklistIdentifierRequestBody.php b/src/Models/Operations/CreateBlocklistIdentifierRequestBody.php index a1958cd..857ef12 100644 --- a/src/Models/Operations/CreateBlocklistIdentifierRequestBody.php +++ b/src/Models/Operations/CreateBlocklistIdentifierRequestBody.php @@ -23,6 +23,7 @@ class CreateBlocklistIdentifierRequestBody /** * @param string $identifier + * @phpstan-pure */ public function __construct(string $identifier) { diff --git a/src/Models/Operations/CreateBlocklistIdentifierResponse.php b/src/Models/Operations/CreateBlocklistIdentifierResponse.php index 9627367..a77c1e0 100644 --- a/src/Models/Operations/CreateBlocklistIdentifierResponse.php +++ b/src/Models/Operations/CreateBlocklistIdentifierResponse.php @@ -44,6 +44,7 @@ class CreateBlocklistIdentifierResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\BlocklistIdentifier $blocklistIdentifier + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\BlocklistIdentifier $blocklistIdentifier = null) { diff --git a/src/Models/Operations/CreateBulkInvitationsResponse.php b/src/Models/Operations/CreateBulkInvitationsResponse.php index 2256b4a..4bcfcda 100644 --- a/src/Models/Operations/CreateBulkInvitationsResponse.php +++ b/src/Models/Operations/CreateBulkInvitationsResponse.php @@ -44,6 +44,7 @@ class CreateBulkInvitationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $invitationList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $invitationList = null) { diff --git a/src/Models/Operations/CreateEmailAddressRequestBody.php b/src/Models/Operations/CreateEmailAddressRequestBody.php index 7c33ebc..9c1a8ec 100644 --- a/src/Models/Operations/CreateEmailAddressRequestBody.php +++ b/src/Models/Operations/CreateEmailAddressRequestBody.php @@ -54,6 +54,7 @@ class CreateEmailAddressRequestBody * @param ?string $emailAddress * @param ?bool $verified * @param ?bool $primary + * @phpstan-pure */ public function __construct(?string $userId = null, ?string $emailAddress = null, ?bool $verified = null, ?bool $primary = null) { diff --git a/src/Models/Operations/CreateEmailAddressResponse.php b/src/Models/Operations/CreateEmailAddressResponse.php index 0f6738e..ada6994 100644 --- a/src/Models/Operations/CreateEmailAddressResponse.php +++ b/src/Models/Operations/CreateEmailAddressResponse.php @@ -44,6 +44,7 @@ class CreateEmailAddressResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\EmailAddress $emailAddress + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\EmailAddress $emailAddress = null) { diff --git a/src/Models/Operations/CreateInvitationRequestBody.php b/src/Models/Operations/CreateInvitationRequestBody.php index b5a04bd..e0931b2 100644 --- a/src/Models/Operations/CreateInvitationRequestBody.php +++ b/src/Models/Operations/CreateInvitationRequestBody.php @@ -93,6 +93,7 @@ class CreateInvitationRequestBody * @param ?bool $ignoreExisting * @param ?int $expiresInDays * @param ?TemplateSlug $templateSlug + * @phpstan-pure */ public function __construct(string $emailAddress, ?array $publicMetadata = null, ?string $redirectUrl = null, ?int $expiresInDays = null, ?TemplateSlug $templateSlug = null, ?bool $notify = true, ?bool $ignoreExisting = false) { diff --git a/src/Models/Operations/CreateInvitationResponse.php b/src/Models/Operations/CreateInvitationResponse.php index cebee43..8afc61a 100644 --- a/src/Models/Operations/CreateInvitationResponse.php +++ b/src/Models/Operations/CreateInvitationResponse.php @@ -44,6 +44,7 @@ class CreateInvitationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Invitation $invitation + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Invitation $invitation = null) { diff --git a/src/Models/Operations/CreateJWTTemplateRequestBody.php b/src/Models/Operations/CreateJWTTemplateRequestBody.php index 15bf275..c4095fe 100644 --- a/src/Models/Operations/CreateJWTTemplateRequestBody.php +++ b/src/Models/Operations/CreateJWTTemplateRequestBody.php @@ -83,6 +83,7 @@ class CreateJWTTemplateRequestBody * @param ?float $allowedClockSkew * @param ?string $signingAlgorithm * @param ?string $signingKey + * @phpstan-pure */ public function __construct(?string $name = null, ?Claims $claims = null, ?bool $customSigningKey = null, ?float $lifetime = null, ?float $allowedClockSkew = null, ?string $signingAlgorithm = null, ?string $signingKey = null) { diff --git a/src/Models/Operations/CreateJWTTemplateResponse.php b/src/Models/Operations/CreateJWTTemplateResponse.php index 793f9ef..3945878 100644 --- a/src/Models/Operations/CreateJWTTemplateResponse.php +++ b/src/Models/Operations/CreateJWTTemplateResponse.php @@ -44,6 +44,7 @@ class CreateJWTTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\JWTTemplate $jwtTemplate + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\JWTTemplate $jwtTemplate = null) { diff --git a/src/Models/Operations/CreateOAuthApplicationRequestBody.php b/src/Models/Operations/CreateOAuthApplicationRequestBody.php index ea1e96c..cb1bfae 100644 --- a/src/Models/Operations/CreateOAuthApplicationRequestBody.php +++ b/src/Models/Operations/CreateOAuthApplicationRequestBody.php @@ -19,20 +19,28 @@ class CreateOAuthApplicationRequestBody #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * An array of redirect URIs of the new OAuth application + * + * @var ?array $redirectUris + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('redirect_uris')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $redirectUris = null; + /** * The callback URL of the new OAuth application * * @var ?string $callbackUrl + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ #[\Speakeasy\Serializer\Annotation\SerializedName('callback_url')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $callbackUrl = null; /** - * If true, this client is public and cannot securely store a client secret. - * - * Only the authorization code flow with proof key for code exchange (PKCE) may be used. - * Public clients cannot be updated to be confidential clients, and vice versa. + * If true, this client is public and you can use the Proof Key of Code Exchange (PKCE) flow. * * @var ?bool $public */ @@ -51,13 +59,16 @@ class CreateOAuthApplicationRequestBody /** * @param string $name + * @param ?array $redirectUris * @param ?string $callbackUrl * @param ?string $scopes * @param ?bool $public + * @phpstan-pure */ - public function __construct(string $name, ?string $callbackUrl = null, ?bool $public = null, ?string $scopes = 'profile email') + public function __construct(string $name, ?array $redirectUris = null, ?string $callbackUrl = null, ?bool $public = null, ?string $scopes = 'profile email') { $this->name = $name; + $this->redirectUris = $redirectUris; $this->callbackUrl = $callbackUrl; $this->public = $public; $this->scopes = $scopes; diff --git a/src/Models/Operations/CreateOAuthApplicationResponse.php b/src/Models/Operations/CreateOAuthApplicationResponse.php index fbe55de..a3e53b1 100644 --- a/src/Models/Operations/CreateOAuthApplicationResponse.php +++ b/src/Models/Operations/CreateOAuthApplicationResponse.php @@ -44,6 +44,7 @@ class CreateOAuthApplicationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OAuthApplicationWithSecret $oAuthApplicationWithSecret + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OAuthApplicationWithSecret $oAuthApplicationWithSecret = null) { diff --git a/src/Models/Operations/CreateOrganizationDomainRequest.php b/src/Models/Operations/CreateOrganizationDomainRequest.php index 756be4f..ae86806 100644 --- a/src/Models/Operations/CreateOrganizationDomainRequest.php +++ b/src/Models/Operations/CreateOrganizationDomainRequest.php @@ -29,6 +29,7 @@ class CreateOrganizationDomainRequest /** * @param string $organizationId * @param CreateOrganizationDomainRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, CreateOrganizationDomainRequestBody $requestBody) { diff --git a/src/Models/Operations/CreateOrganizationDomainRequestBody.php b/src/Models/Operations/CreateOrganizationDomainRequestBody.php index e957111..47fb89c 100644 --- a/src/Models/Operations/CreateOrganizationDomainRequestBody.php +++ b/src/Models/Operations/CreateOrganizationDomainRequestBody.php @@ -42,6 +42,7 @@ class CreateOrganizationDomainRequestBody * @param ?string $name * @param ?string $enrollmentMode * @param ?bool $verified + * @phpstan-pure */ public function __construct(?string $name = null, ?string $enrollmentMode = null, ?bool $verified = null) { diff --git a/src/Models/Operations/CreateOrganizationDomainResponse.php b/src/Models/Operations/CreateOrganizationDomainResponse.php index 059e6c9..0ceb549 100644 --- a/src/Models/Operations/CreateOrganizationDomainResponse.php +++ b/src/Models/Operations/CreateOrganizationDomainResponse.php @@ -44,6 +44,7 @@ class CreateOrganizationDomainResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationDomain $organizationDomain + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationDomain $organizationDomain = null) { diff --git a/src/Models/Operations/CreateOrganizationInvitationBulkRequest.php b/src/Models/Operations/CreateOrganizationInvitationBulkRequest.php index d7fa93f..9d0006f 100644 --- a/src/Models/Operations/CreateOrganizationInvitationBulkRequest.php +++ b/src/Models/Operations/CreateOrganizationInvitationBulkRequest.php @@ -30,6 +30,7 @@ class CreateOrganizationInvitationBulkRequest /** * @param string $organizationId * @param array $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, array $requestBody) { diff --git a/src/Models/Operations/CreateOrganizationInvitationBulkRequestBody.php b/src/Models/Operations/CreateOrganizationInvitationBulkRequestBody.php index 3598168..433ba9e 100644 --- a/src/Models/Operations/CreateOrganizationInvitationBulkRequestBody.php +++ b/src/Models/Operations/CreateOrganizationInvitationBulkRequestBody.php @@ -78,6 +78,7 @@ class CreateOrganizationInvitationBulkRequestBody * @param ?array $privateMetadata * @param ?string $redirectUrl * @param ?string $inviterUserId + * @phpstan-pure */ public function __construct(string $emailAddress, string $role, ?array $publicMetadata = null, ?array $privateMetadata = null, ?string $redirectUrl = null, ?string $inviterUserId = null) { diff --git a/src/Models/Operations/CreateOrganizationInvitationBulkResponse.php b/src/Models/Operations/CreateOrganizationInvitationBulkResponse.php index 46fa955..ce30a1d 100644 --- a/src/Models/Operations/CreateOrganizationInvitationBulkResponse.php +++ b/src/Models/Operations/CreateOrganizationInvitationBulkResponse.php @@ -44,6 +44,7 @@ class CreateOrganizationInvitationBulkResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitations $organizationInvitations + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitations $organizationInvitations = null) { diff --git a/src/Models/Operations/CreateOrganizationInvitationRequest.php b/src/Models/Operations/CreateOrganizationInvitationRequest.php index 10ee707..3627bde 100644 --- a/src/Models/Operations/CreateOrganizationInvitationRequest.php +++ b/src/Models/Operations/CreateOrganizationInvitationRequest.php @@ -29,6 +29,7 @@ class CreateOrganizationInvitationRequest /** * @param string $organizationId * @param ?CreateOrganizationInvitationRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, ?CreateOrganizationInvitationRequestBody $requestBody = null) { diff --git a/src/Models/Operations/CreateOrganizationInvitationRequestBody.php b/src/Models/Operations/CreateOrganizationInvitationRequestBody.php index cec0eea..faa9541 100644 --- a/src/Models/Operations/CreateOrganizationInvitationRequestBody.php +++ b/src/Models/Operations/CreateOrganizationInvitationRequestBody.php @@ -88,6 +88,7 @@ class CreateOrganizationInvitationRequestBody * @param ?string $redirectUrl * @param ?string $inviterUserId * @param ?int $expiresInDays + * @phpstan-pure */ public function __construct(string $emailAddress, string $role, ?array $publicMetadata = null, ?array $privateMetadata = null, ?string $redirectUrl = null, ?string $inviterUserId = null, ?int $expiresInDays = null) { diff --git a/src/Models/Operations/CreateOrganizationInvitationResponse.php b/src/Models/Operations/CreateOrganizationInvitationResponse.php index 7beb876..b2e0a96 100644 --- a/src/Models/Operations/CreateOrganizationInvitationResponse.php +++ b/src/Models/Operations/CreateOrganizationInvitationResponse.php @@ -44,6 +44,7 @@ class CreateOrganizationInvitationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitation $organizationInvitation + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitation $organizationInvitation = null) { diff --git a/src/Models/Operations/CreateOrganizationMembershipRequest.php b/src/Models/Operations/CreateOrganizationMembershipRequest.php index 9a9fda7..4449ae5 100644 --- a/src/Models/Operations/CreateOrganizationMembershipRequest.php +++ b/src/Models/Operations/CreateOrganizationMembershipRequest.php @@ -29,6 +29,7 @@ class CreateOrganizationMembershipRequest /** * @param string $organizationId * @param CreateOrganizationMembershipRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, CreateOrganizationMembershipRequestBody $requestBody) { diff --git a/src/Models/Operations/CreateOrganizationMembershipRequestBody.php b/src/Models/Operations/CreateOrganizationMembershipRequestBody.php index 4da5d1d..c509fb3 100644 --- a/src/Models/Operations/CreateOrganizationMembershipRequestBody.php +++ b/src/Models/Operations/CreateOrganizationMembershipRequestBody.php @@ -32,6 +32,7 @@ class CreateOrganizationMembershipRequestBody /** * @param string $userId * @param string $role + * @phpstan-pure */ public function __construct(string $userId, string $role) { diff --git a/src/Models/Operations/CreateOrganizationMembershipResponse.php b/src/Models/Operations/CreateOrganizationMembershipResponse.php index d2459c6..4b6e9b0 100644 --- a/src/Models/Operations/CreateOrganizationMembershipResponse.php +++ b/src/Models/Operations/CreateOrganizationMembershipResponse.php @@ -44,6 +44,7 @@ class CreateOrganizationMembershipResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationMembership $organizationMembership + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationMembership $organizationMembership = null) { diff --git a/src/Models/Operations/CreateOrganizationRequestBody.php b/src/Models/Operations/CreateOrganizationRequestBody.php index 2abac72..82ca03b 100644 --- a/src/Models/Operations/CreateOrganizationRequestBody.php +++ b/src/Models/Operations/CreateOrganizationRequestBody.php @@ -88,6 +88,7 @@ class CreateOrganizationRequestBody * @param ?string $slug * @param ?int $maxAllowedMemberships * @param ?string $createdAt + * @phpstan-pure */ public function __construct(string $name, ?string $createdBy = null, ?array $privateMetadata = null, ?array $publicMetadata = null, ?string $slug = null, ?int $maxAllowedMemberships = null, ?string $createdAt = null) { diff --git a/src/Models/Operations/CreateOrganizationResponse.php b/src/Models/Operations/CreateOrganizationResponse.php index bb5f023..aa36737 100644 --- a/src/Models/Operations/CreateOrganizationResponse.php +++ b/src/Models/Operations/CreateOrganizationResponse.php @@ -44,6 +44,7 @@ class CreateOrganizationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/CreatePhoneNumberRequestBody.php b/src/Models/Operations/CreatePhoneNumberRequestBody.php index 028cd68..567f8a9 100644 --- a/src/Models/Operations/CreatePhoneNumberRequestBody.php +++ b/src/Models/Operations/CreatePhoneNumberRequestBody.php @@ -67,6 +67,7 @@ class CreatePhoneNumberRequestBody * @param ?bool $verified * @param ?bool $primary * @param ?bool $reservedForSecondFactor + * @phpstan-pure */ public function __construct(?string $userId = null, ?string $phoneNumber = null, ?bool $verified = null, ?bool $primary = null, ?bool $reservedForSecondFactor = null) { diff --git a/src/Models/Operations/CreatePhoneNumberResponse.php b/src/Models/Operations/CreatePhoneNumberResponse.php index 43d7c9e..d113dfa 100644 --- a/src/Models/Operations/CreatePhoneNumberResponse.php +++ b/src/Models/Operations/CreatePhoneNumberResponse.php @@ -44,6 +44,7 @@ class CreatePhoneNumberResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\PhoneNumber $phoneNumber + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\PhoneNumber $phoneNumber = null) { diff --git a/src/Models/Operations/CreateRedirectURLRequestBody.php b/src/Models/Operations/CreateRedirectURLRequestBody.php index 87e8fad..6f23e26 100644 --- a/src/Models/Operations/CreateRedirectURLRequestBody.php +++ b/src/Models/Operations/CreateRedirectURLRequestBody.php @@ -22,6 +22,7 @@ class CreateRedirectURLRequestBody /** * @param ?string $url + * @phpstan-pure */ public function __construct(?string $url = null) { diff --git a/src/Models/Operations/CreateRedirectURLResponse.php b/src/Models/Operations/CreateRedirectURLResponse.php index 8f40c56..ee57f91 100644 --- a/src/Models/Operations/CreateRedirectURLResponse.php +++ b/src/Models/Operations/CreateRedirectURLResponse.php @@ -44,6 +44,7 @@ class CreateRedirectURLResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\RedirectURL $redirectURL + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\RedirectURL $redirectURL = null) { diff --git a/src/Models/Operations/CreateSAMLConnectionRequestBody.php b/src/Models/Operations/CreateSAMLConnectionRequestBody.php index fa80fe7..b6df4f5 100644 --- a/src/Models/Operations/CreateSAMLConnectionRequestBody.php +++ b/src/Models/Operations/CreateSAMLConnectionRequestBody.php @@ -111,6 +111,7 @@ class CreateSAMLConnectionRequestBody * @param ?string $idpMetadata * @param ?string $organizationId * @param ?AttributeMapping $attributeMapping + * @phpstan-pure */ public function __construct(string $name, string $domain, Provider $provider, ?string $idpEntityId = null, ?string $idpSsoUrl = null, ?string $idpCertificate = null, ?string $idpMetadataUrl = null, ?string $idpMetadata = null, ?string $organizationId = null, ?AttributeMapping $attributeMapping = null) { diff --git a/src/Models/Operations/CreateSAMLConnectionResponse.php b/src/Models/Operations/CreateSAMLConnectionResponse.php index 008bd05..2323c71 100644 --- a/src/Models/Operations/CreateSAMLConnectionResponse.php +++ b/src/Models/Operations/CreateSAMLConnectionResponse.php @@ -44,6 +44,7 @@ class CreateSAMLConnectionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SchemasSAMLConnection $schemasSAMLConnection + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SchemasSAMLConnection $schemasSAMLConnection = null) { diff --git a/src/Models/Operations/CreateSessionRequestBody.php b/src/Models/Operations/CreateSessionRequestBody.php index ce39133..399c3a1 100644 --- a/src/Models/Operations/CreateSessionRequestBody.php +++ b/src/Models/Operations/CreateSessionRequestBody.php @@ -22,6 +22,7 @@ class CreateSessionRequestBody /** * @param ?string $userId + * @phpstan-pure */ public function __construct(?string $userId = null) { diff --git a/src/Models/Operations/CreateSessionResponse.php b/src/Models/Operations/CreateSessionResponse.php index 6fe00b3..73effe5 100644 --- a/src/Models/Operations/CreateSessionResponse.php +++ b/src/Models/Operations/CreateSessionResponse.php @@ -44,6 +44,7 @@ class CreateSessionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Session $session + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Session $session = null) { diff --git a/src/Models/Operations/CreateSessionTokenFromTemplateRequest.php b/src/Models/Operations/CreateSessionTokenFromTemplateRequest.php index ad6e363..ccc9070 100644 --- a/src/Models/Operations/CreateSessionTokenFromTemplateRequest.php +++ b/src/Models/Operations/CreateSessionTokenFromTemplateRequest.php @@ -38,6 +38,7 @@ class CreateSessionTokenFromTemplateRequest * @param string $sessionId * @param string $templateName * @param ?CreateSessionTokenFromTemplateRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $sessionId, string $templateName, ?CreateSessionTokenFromTemplateRequestBody $requestBody = null) { diff --git a/src/Models/Operations/CreateSessionTokenFromTemplateRequestBody.php b/src/Models/Operations/CreateSessionTokenFromTemplateRequestBody.php index 72803ea..a8303fc 100644 --- a/src/Models/Operations/CreateSessionTokenFromTemplateRequestBody.php +++ b/src/Models/Operations/CreateSessionTokenFromTemplateRequestBody.php @@ -22,6 +22,7 @@ class CreateSessionTokenFromTemplateRequestBody /** * @param ?float $expiresInSeconds + * @phpstan-pure */ public function __construct(?float $expiresInSeconds = null) { diff --git a/src/Models/Operations/CreateSessionTokenFromTemplateResponse.php b/src/Models/Operations/CreateSessionTokenFromTemplateResponse.php index 59f9db6..c892c53 100644 --- a/src/Models/Operations/CreateSessionTokenFromTemplateResponse.php +++ b/src/Models/Operations/CreateSessionTokenFromTemplateResponse.php @@ -44,6 +44,7 @@ class CreateSessionTokenFromTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?CreateSessionTokenFromTemplateResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?CreateSessionTokenFromTemplateResponseBody $object = null) { diff --git a/src/Models/Operations/CreateSessionTokenFromTemplateResponseBody.php b/src/Models/Operations/CreateSessionTokenFromTemplateResponseBody.php index 4d88b66..843f63c 100644 --- a/src/Models/Operations/CreateSessionTokenFromTemplateResponseBody.php +++ b/src/Models/Operations/CreateSessionTokenFromTemplateResponseBody.php @@ -32,6 +32,7 @@ class CreateSessionTokenFromTemplateResponseBody /** * @param ?CreateSessionTokenFromTemplateObject $object * @param ?string $jwt + * @phpstan-pure */ public function __construct(?CreateSessionTokenFromTemplateObject $object = null, ?string $jwt = null) { diff --git a/src/Models/Operations/CreateSessionTokenRequest.php b/src/Models/Operations/CreateSessionTokenRequest.php index 3d3e1dc..246a1f8 100644 --- a/src/Models/Operations/CreateSessionTokenRequest.php +++ b/src/Models/Operations/CreateSessionTokenRequest.php @@ -29,6 +29,7 @@ class CreateSessionTokenRequest /** * @param string $sessionId * @param ?CreateSessionTokenRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $sessionId, ?CreateSessionTokenRequestBody $requestBody = null) { diff --git a/src/Models/Operations/CreateSessionTokenRequestBody.php b/src/Models/Operations/CreateSessionTokenRequestBody.php index 68e5e2a..f0b4d56 100644 --- a/src/Models/Operations/CreateSessionTokenRequestBody.php +++ b/src/Models/Operations/CreateSessionTokenRequestBody.php @@ -22,6 +22,7 @@ class CreateSessionTokenRequestBody /** * @param ?float $expiresInSeconds + * @phpstan-pure */ public function __construct(?float $expiresInSeconds = null) { diff --git a/src/Models/Operations/CreateSessionTokenResponse.php b/src/Models/Operations/CreateSessionTokenResponse.php index a85e4d3..3cc6956 100644 --- a/src/Models/Operations/CreateSessionTokenResponse.php +++ b/src/Models/Operations/CreateSessionTokenResponse.php @@ -44,6 +44,7 @@ class CreateSessionTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?CreateSessionTokenResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?CreateSessionTokenResponseBody $object = null) { diff --git a/src/Models/Operations/CreateSessionTokenResponseBody.php b/src/Models/Operations/CreateSessionTokenResponseBody.php index 2db3660..ecac8a3 100644 --- a/src/Models/Operations/CreateSessionTokenResponseBody.php +++ b/src/Models/Operations/CreateSessionTokenResponseBody.php @@ -32,6 +32,7 @@ class CreateSessionTokenResponseBody /** * @param ?ObjectT $object * @param ?string $jwt + * @phpstan-pure */ public function __construct(?ObjectT $object = null, ?string $jwt = null) { diff --git a/src/Models/Operations/CreateSignInTokenRequestBody.php b/src/Models/Operations/CreateSignInTokenRequestBody.php index f3179ff..50d57cd 100644 --- a/src/Models/Operations/CreateSignInTokenRequestBody.php +++ b/src/Models/Operations/CreateSignInTokenRequestBody.php @@ -34,6 +34,7 @@ class CreateSignInTokenRequestBody /** * @param ?string $userId * @param ?int $expiresInSeconds + * @phpstan-pure */ public function __construct(?string $userId = null, ?int $expiresInSeconds = 2592000) { diff --git a/src/Models/Operations/CreateSignInTokenResponse.php b/src/Models/Operations/CreateSignInTokenResponse.php index b7d6f6c..b7c4afc 100644 --- a/src/Models/Operations/CreateSignInTokenResponse.php +++ b/src/Models/Operations/CreateSignInTokenResponse.php @@ -44,6 +44,7 @@ class CreateSignInTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SignInToken $signInToken + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SignInToken $signInToken = null) { diff --git a/src/Models/Operations/CreateSvixAppResponse.php b/src/Models/Operations/CreateSvixAppResponse.php index 30bcef0..575b7b8 100644 --- a/src/Models/Operations/CreateSvixAppResponse.php +++ b/src/Models/Operations/CreateSvixAppResponse.php @@ -44,6 +44,7 @@ class CreateSvixAppResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SvixURL $svixURL + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SvixURL $svixURL = null) { diff --git a/src/Models/Operations/CreateTestingTokenResponse.php b/src/Models/Operations/CreateTestingTokenResponse.php index 609d428..2affb34 100644 --- a/src/Models/Operations/CreateTestingTokenResponse.php +++ b/src/Models/Operations/CreateTestingTokenResponse.php @@ -44,6 +44,7 @@ class CreateTestingTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\TestingToken $testingToken + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\TestingToken $testingToken = null) { diff --git a/src/Models/Operations/CreateUserRequestBody.php b/src/Models/Operations/CreateUserRequestBody.php index fb0cdac..6ae0ec5 100644 --- a/src/Models/Operations/CreateUserRequestBody.php +++ b/src/Models/Operations/CreateUserRequestBody.php @@ -298,6 +298,7 @@ class CreateUserRequestBody * @param ?bool $skipLegalChecks * @param ?bool $createOrganizationEnabled * @param ?int $createOrganizationsLimit + * @phpstan-pure */ public function __construct(?array $emailAddress = null, ?array $phoneNumber = null, ?array $web3Wallet = null, ?string $passwordDigest = null, ?string $passwordHasher = null, ?bool $skipPasswordChecks = null, ?bool $skipPasswordRequirement = null, ?string $totpSecret = null, ?array $backupCodes = null, ?array $publicMetadata = null, ?array $privateMetadata = null, ?array $unsafeMetadata = null, ?string $createdAt = null, ?string $externalId = null, ?string $firstName = null, ?string $lastName = null, ?string $username = null, ?string $password = null, ?bool $deleteSelfEnabled = null, ?string $legalAcceptedAt = null, ?bool $skipLegalChecks = null, ?bool $createOrganizationEnabled = null, ?int $createOrganizationsLimit = null) { diff --git a/src/Models/Operations/CreateUserResponse.php b/src/Models/Operations/CreateUserResponse.php index c3fac85..c19199c 100644 --- a/src/Models/Operations/CreateUserResponse.php +++ b/src/Models/Operations/CreateUserResponse.php @@ -44,6 +44,7 @@ class CreateUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/CreateUserTOTPRequest.php b/src/Models/Operations/CreateUserTOTPRequest.php deleted file mode 100644 index a6658f4..0000000 --- a/src/Models/Operations/CreateUserTOTPRequest.php +++ /dev/null @@ -1,29 +0,0 @@ -userId = $userId; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateUserTOTPResponse.php b/src/Models/Operations/CreateUserTOTPResponse.php deleted file mode 100644 index 32b56f1..0000000 --- a/src/Models/Operations/CreateUserTOTPResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - $totp - */ - public ?array $totp = null; - - /** - * @param string $contentType - * @param int $statusCode - * @param \Psr\Http\Message\ResponseInterface $rawResponse - * @param ?array $totp - */ - public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $totp = null) - { - $this->contentType = $contentType; - $this->statusCode = $statusCode; - $this->rawResponse = $rawResponse; - $this->totp = $totp; - } -} \ No newline at end of file diff --git a/src/Models/Operations/CreateWaitlistEntryRequestBody.php b/src/Models/Operations/CreateWaitlistEntryRequestBody.php index 16fdabd..754299d 100644 --- a/src/Models/Operations/CreateWaitlistEntryRequestBody.php +++ b/src/Models/Operations/CreateWaitlistEntryRequestBody.php @@ -33,6 +33,7 @@ class CreateWaitlistEntryRequestBody /** * @param string $emailAddress * @param ?bool $notify + * @phpstan-pure */ public function __construct(string $emailAddress, ?bool $notify = null) { diff --git a/src/Models/Operations/CreateWaitlistEntryResponse.php b/src/Models/Operations/CreateWaitlistEntryResponse.php index cddc0fd..f0a492a 100644 --- a/src/Models/Operations/CreateWaitlistEntryResponse.php +++ b/src/Models/Operations/CreateWaitlistEntryResponse.php @@ -44,6 +44,7 @@ class CreateWaitlistEntryResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\WaitlistEntry $waitlistEntry + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\WaitlistEntry $waitlistEntry = null) { diff --git a/src/Models/Operations/DeleteAllowlistIdentifierRequest.php b/src/Models/Operations/DeleteAllowlistIdentifierRequest.php index 39f353f..5c62b90 100644 --- a/src/Models/Operations/DeleteAllowlistIdentifierRequest.php +++ b/src/Models/Operations/DeleteAllowlistIdentifierRequest.php @@ -21,6 +21,7 @@ class DeleteAllowlistIdentifierRequest /** * @param string $identifierId + * @phpstan-pure */ public function __construct(string $identifierId) { diff --git a/src/Models/Operations/DeleteAllowlistIdentifierResponse.php b/src/Models/Operations/DeleteAllowlistIdentifierResponse.php index d1dad07..06a9fc7 100644 --- a/src/Models/Operations/DeleteAllowlistIdentifierResponse.php +++ b/src/Models/Operations/DeleteAllowlistIdentifierResponse.php @@ -44,6 +44,7 @@ class DeleteAllowlistIdentifierResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteBackupCodeRequest.php b/src/Models/Operations/DeleteBackupCodeRequest.php index 78152f8..8aced09 100644 --- a/src/Models/Operations/DeleteBackupCodeRequest.php +++ b/src/Models/Operations/DeleteBackupCodeRequest.php @@ -21,6 +21,7 @@ class DeleteBackupCodeRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/DeleteBackupCodeResponse.php b/src/Models/Operations/DeleteBackupCodeResponse.php index dd55fbe..796aeb4 100644 --- a/src/Models/Operations/DeleteBackupCodeResponse.php +++ b/src/Models/Operations/DeleteBackupCodeResponse.php @@ -44,6 +44,7 @@ class DeleteBackupCodeResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?DeleteBackupCodeResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?DeleteBackupCodeResponseBody $object = null) { diff --git a/src/Models/Operations/DeleteBackupCodeResponseBody.php b/src/Models/Operations/DeleteBackupCodeResponseBody.php index 553f8b5..4d3316a 100644 --- a/src/Models/Operations/DeleteBackupCodeResponseBody.php +++ b/src/Models/Operations/DeleteBackupCodeResponseBody.php @@ -22,6 +22,7 @@ class DeleteBackupCodeResponseBody /** * @param ?string $userId + * @phpstan-pure */ public function __construct(?string $userId = null) { diff --git a/src/Models/Operations/DeleteBlocklistIdentifierRequest.php b/src/Models/Operations/DeleteBlocklistIdentifierRequest.php index f4ee77c..cbbda57 100644 --- a/src/Models/Operations/DeleteBlocklistIdentifierRequest.php +++ b/src/Models/Operations/DeleteBlocklistIdentifierRequest.php @@ -21,6 +21,7 @@ class DeleteBlocklistIdentifierRequest /** * @param string $identifierId + * @phpstan-pure */ public function __construct(string $identifierId) { diff --git a/src/Models/Operations/DeleteBlocklistIdentifierResponse.php b/src/Models/Operations/DeleteBlocklistIdentifierResponse.php index dbc37d6..d792147 100644 --- a/src/Models/Operations/DeleteBlocklistIdentifierResponse.php +++ b/src/Models/Operations/DeleteBlocklistIdentifierResponse.php @@ -44,6 +44,7 @@ class DeleteBlocklistIdentifierResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteDomainRequest.php b/src/Models/Operations/DeleteDomainRequest.php index 334c60e..acb0273 100644 --- a/src/Models/Operations/DeleteDomainRequest.php +++ b/src/Models/Operations/DeleteDomainRequest.php @@ -21,6 +21,7 @@ class DeleteDomainRequest /** * @param string $domainId + * @phpstan-pure */ public function __construct(string $domainId) { diff --git a/src/Models/Operations/DeleteDomainResponse.php b/src/Models/Operations/DeleteDomainResponse.php index bb07fb9..c44d32b 100644 --- a/src/Models/Operations/DeleteDomainResponse.php +++ b/src/Models/Operations/DeleteDomainResponse.php @@ -44,6 +44,7 @@ class DeleteDomainResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteEmailAddressRequest.php b/src/Models/Operations/DeleteEmailAddressRequest.php index 7175e87..44d658b 100644 --- a/src/Models/Operations/DeleteEmailAddressRequest.php +++ b/src/Models/Operations/DeleteEmailAddressRequest.php @@ -21,6 +21,7 @@ class DeleteEmailAddressRequest /** * @param string $emailAddressId + * @phpstan-pure */ public function __construct(string $emailAddressId) { diff --git a/src/Models/Operations/DeleteEmailAddressResponse.php b/src/Models/Operations/DeleteEmailAddressResponse.php index 04ee763..0708683 100644 --- a/src/Models/Operations/DeleteEmailAddressResponse.php +++ b/src/Models/Operations/DeleteEmailAddressResponse.php @@ -44,6 +44,7 @@ class DeleteEmailAddressResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteExternalAccountRequest.php b/src/Models/Operations/DeleteExternalAccountRequest.php index 29377ab..b9bb7ff 100644 --- a/src/Models/Operations/DeleteExternalAccountRequest.php +++ b/src/Models/Operations/DeleteExternalAccountRequest.php @@ -30,6 +30,7 @@ class DeleteExternalAccountRequest /** * @param string $userId * @param string $externalAccountId + * @phpstan-pure */ public function __construct(string $userId, string $externalAccountId) { diff --git a/src/Models/Operations/DeleteExternalAccountResponse.php b/src/Models/Operations/DeleteExternalAccountResponse.php index d484ee6..39c57c9 100644 --- a/src/Models/Operations/DeleteExternalAccountResponse.php +++ b/src/Models/Operations/DeleteExternalAccountResponse.php @@ -44,6 +44,7 @@ class DeleteExternalAccountResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteJWTTemplateRequest.php b/src/Models/Operations/DeleteJWTTemplateRequest.php index 3edd0bf..6fad9b0 100644 --- a/src/Models/Operations/DeleteJWTTemplateRequest.php +++ b/src/Models/Operations/DeleteJWTTemplateRequest.php @@ -21,6 +21,7 @@ class DeleteJWTTemplateRequest /** * @param string $templateId + * @phpstan-pure */ public function __construct(string $templateId) { diff --git a/src/Models/Operations/DeleteJWTTemplateResponse.php b/src/Models/Operations/DeleteJWTTemplateResponse.php index f509140..8c737d4 100644 --- a/src/Models/Operations/DeleteJWTTemplateResponse.php +++ b/src/Models/Operations/DeleteJWTTemplateResponse.php @@ -44,6 +44,7 @@ class DeleteJWTTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteOAuthApplicationRequest.php b/src/Models/Operations/DeleteOAuthApplicationRequest.php index 84badd2..508df9f 100644 --- a/src/Models/Operations/DeleteOAuthApplicationRequest.php +++ b/src/Models/Operations/DeleteOAuthApplicationRequest.php @@ -21,6 +21,7 @@ class DeleteOAuthApplicationRequest /** * @param string $oauthApplicationId + * @phpstan-pure */ public function __construct(string $oauthApplicationId) { diff --git a/src/Models/Operations/DeleteOAuthApplicationResponse.php b/src/Models/Operations/DeleteOAuthApplicationResponse.php index fda77e7..1f87776 100644 --- a/src/Models/Operations/DeleteOAuthApplicationResponse.php +++ b/src/Models/Operations/DeleteOAuthApplicationResponse.php @@ -44,6 +44,7 @@ class DeleteOAuthApplicationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteOrganizationDomainRequest.php b/src/Models/Operations/DeleteOrganizationDomainRequest.php index fbf3521..521c371 100644 --- a/src/Models/Operations/DeleteOrganizationDomainRequest.php +++ b/src/Models/Operations/DeleteOrganizationDomainRequest.php @@ -30,6 +30,7 @@ class DeleteOrganizationDomainRequest /** * @param string $organizationId * @param string $domainId + * @phpstan-pure */ public function __construct(string $organizationId, string $domainId) { diff --git a/src/Models/Operations/DeleteOrganizationDomainResponse.php b/src/Models/Operations/DeleteOrganizationDomainResponse.php index 79072b8..8478c13 100644 --- a/src/Models/Operations/DeleteOrganizationDomainResponse.php +++ b/src/Models/Operations/DeleteOrganizationDomainResponse.php @@ -44,6 +44,7 @@ class DeleteOrganizationDomainResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteOrganizationLogoRequest.php b/src/Models/Operations/DeleteOrganizationLogoRequest.php index 8195432..cef6eaf 100644 --- a/src/Models/Operations/DeleteOrganizationLogoRequest.php +++ b/src/Models/Operations/DeleteOrganizationLogoRequest.php @@ -21,6 +21,7 @@ class DeleteOrganizationLogoRequest /** * @param string $organizationId + * @phpstan-pure */ public function __construct(string $organizationId) { diff --git a/src/Models/Operations/DeleteOrganizationLogoResponse.php b/src/Models/Operations/DeleteOrganizationLogoResponse.php index 96b8168..97de874 100644 --- a/src/Models/Operations/DeleteOrganizationLogoResponse.php +++ b/src/Models/Operations/DeleteOrganizationLogoResponse.php @@ -44,6 +44,7 @@ class DeleteOrganizationLogoResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/DeleteOrganizationMembershipRequest.php b/src/Models/Operations/DeleteOrganizationMembershipRequest.php index 5f25988..68e8cd4 100644 --- a/src/Models/Operations/DeleteOrganizationMembershipRequest.php +++ b/src/Models/Operations/DeleteOrganizationMembershipRequest.php @@ -30,6 +30,7 @@ class DeleteOrganizationMembershipRequest /** * @param string $organizationId * @param string $userId + * @phpstan-pure */ public function __construct(string $organizationId, string $userId) { diff --git a/src/Models/Operations/DeleteOrganizationMembershipResponse.php b/src/Models/Operations/DeleteOrganizationMembershipResponse.php index f278fa7..4c27402 100644 --- a/src/Models/Operations/DeleteOrganizationMembershipResponse.php +++ b/src/Models/Operations/DeleteOrganizationMembershipResponse.php @@ -44,6 +44,7 @@ class DeleteOrganizationMembershipResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationMembership $organizationMembership + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationMembership $organizationMembership = null) { diff --git a/src/Models/Operations/DeleteOrganizationRequest.php b/src/Models/Operations/DeleteOrganizationRequest.php index daf1e82..cb9c0ed 100644 --- a/src/Models/Operations/DeleteOrganizationRequest.php +++ b/src/Models/Operations/DeleteOrganizationRequest.php @@ -21,6 +21,7 @@ class DeleteOrganizationRequest /** * @param string $organizationId + * @phpstan-pure */ public function __construct(string $organizationId) { diff --git a/src/Models/Operations/DeleteOrganizationResponse.php b/src/Models/Operations/DeleteOrganizationResponse.php index 7565d3a..1a7648a 100644 --- a/src/Models/Operations/DeleteOrganizationResponse.php +++ b/src/Models/Operations/DeleteOrganizationResponse.php @@ -44,6 +44,7 @@ class DeleteOrganizationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeletePhoneNumberRequest.php b/src/Models/Operations/DeletePhoneNumberRequest.php index 0efd5f0..1983657 100644 --- a/src/Models/Operations/DeletePhoneNumberRequest.php +++ b/src/Models/Operations/DeletePhoneNumberRequest.php @@ -21,6 +21,7 @@ class DeletePhoneNumberRequest /** * @param string $phoneNumberId + * @phpstan-pure */ public function __construct(string $phoneNumberId) { diff --git a/src/Models/Operations/DeletePhoneNumberResponse.php b/src/Models/Operations/DeletePhoneNumberResponse.php index 346aa65..4371aa7 100644 --- a/src/Models/Operations/DeletePhoneNumberResponse.php +++ b/src/Models/Operations/DeletePhoneNumberResponse.php @@ -44,6 +44,7 @@ class DeletePhoneNumberResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteRedirectURLRequest.php b/src/Models/Operations/DeleteRedirectURLRequest.php index b1eb8a0..8a8a4be 100644 --- a/src/Models/Operations/DeleteRedirectURLRequest.php +++ b/src/Models/Operations/DeleteRedirectURLRequest.php @@ -21,6 +21,7 @@ class DeleteRedirectURLRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/DeleteRedirectURLResponse.php b/src/Models/Operations/DeleteRedirectURLResponse.php index ccc8c7a..1a2fdc5 100644 --- a/src/Models/Operations/DeleteRedirectURLResponse.php +++ b/src/Models/Operations/DeleteRedirectURLResponse.php @@ -44,6 +44,7 @@ class DeleteRedirectURLResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteSAMLConnectionRequest.php b/src/Models/Operations/DeleteSAMLConnectionRequest.php index 07d6650..6a99898 100644 --- a/src/Models/Operations/DeleteSAMLConnectionRequest.php +++ b/src/Models/Operations/DeleteSAMLConnectionRequest.php @@ -21,6 +21,7 @@ class DeleteSAMLConnectionRequest /** * @param string $samlConnectionId + * @phpstan-pure */ public function __construct(string $samlConnectionId) { diff --git a/src/Models/Operations/DeleteSAMLConnectionResponse.php b/src/Models/Operations/DeleteSAMLConnectionResponse.php index 430baf5..c1d26f0 100644 --- a/src/Models/Operations/DeleteSAMLConnectionResponse.php +++ b/src/Models/Operations/DeleteSAMLConnectionResponse.php @@ -44,6 +44,7 @@ class DeleteSAMLConnectionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DeleteSvixAppResponse.php b/src/Models/Operations/DeleteSvixAppResponse.php index cf97c42..e37282a 100644 --- a/src/Models/Operations/DeleteSvixAppResponse.php +++ b/src/Models/Operations/DeleteSvixAppResponse.php @@ -36,6 +36,7 @@ class DeleteSvixAppResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/DeleteTOTPRequest.php b/src/Models/Operations/DeleteTOTPRequest.php index 75f0403..439450b 100644 --- a/src/Models/Operations/DeleteTOTPRequest.php +++ b/src/Models/Operations/DeleteTOTPRequest.php @@ -21,6 +21,7 @@ class DeleteTOTPRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/DeleteTOTPResponse.php b/src/Models/Operations/DeleteTOTPResponse.php index e4f4479..9c56dd3 100644 --- a/src/Models/Operations/DeleteTOTPResponse.php +++ b/src/Models/Operations/DeleteTOTPResponse.php @@ -44,6 +44,7 @@ class DeleteTOTPResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?DeleteTOTPResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?DeleteTOTPResponseBody $object = null) { diff --git a/src/Models/Operations/DeleteTOTPResponseBody.php b/src/Models/Operations/DeleteTOTPResponseBody.php index c6b4f91..2dd5361 100644 --- a/src/Models/Operations/DeleteTOTPResponseBody.php +++ b/src/Models/Operations/DeleteTOTPResponseBody.php @@ -22,6 +22,7 @@ class DeleteTOTPResponseBody /** * @param ?string $userId + * @phpstan-pure */ public function __construct(?string $userId = null) { diff --git a/src/Models/Operations/DeleteUserProfileImageRequest.php b/src/Models/Operations/DeleteUserProfileImageRequest.php index e406bd8..eb92fac 100644 --- a/src/Models/Operations/DeleteUserProfileImageRequest.php +++ b/src/Models/Operations/DeleteUserProfileImageRequest.php @@ -21,6 +21,7 @@ class DeleteUserProfileImageRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/DeleteUserProfileImageResponse.php b/src/Models/Operations/DeleteUserProfileImageResponse.php index d517bc6..f7100a1 100644 --- a/src/Models/Operations/DeleteUserProfileImageResponse.php +++ b/src/Models/Operations/DeleteUserProfileImageResponse.php @@ -44,6 +44,7 @@ class DeleteUserProfileImageResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/DeleteUserRequest.php b/src/Models/Operations/DeleteUserRequest.php index c48fc65..b619453 100644 --- a/src/Models/Operations/DeleteUserRequest.php +++ b/src/Models/Operations/DeleteUserRequest.php @@ -21,6 +21,7 @@ class DeleteUserRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/DeleteUserResponse.php b/src/Models/Operations/DeleteUserResponse.php index 1076763..c77f3af 100644 --- a/src/Models/Operations/DeleteUserResponse.php +++ b/src/Models/Operations/DeleteUserResponse.php @@ -44,6 +44,7 @@ class DeleteUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/DisableMFARequest.php b/src/Models/Operations/DisableMFARequest.php index 6616a18..3d5af1d 100644 --- a/src/Models/Operations/DisableMFARequest.php +++ b/src/Models/Operations/DisableMFARequest.php @@ -21,6 +21,7 @@ class DisableMFARequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/DisableMFAResponse.php b/src/Models/Operations/DisableMFAResponse.php index e5338e7..a398e5e 100644 --- a/src/Models/Operations/DisableMFAResponse.php +++ b/src/Models/Operations/DisableMFAResponse.php @@ -44,6 +44,7 @@ class DisableMFAResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?DisableMFAResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?DisableMFAResponseBody $object = null) { diff --git a/src/Models/Operations/DisableMFAResponseBody.php b/src/Models/Operations/DisableMFAResponseBody.php index 5bf83f6..721e612 100644 --- a/src/Models/Operations/DisableMFAResponseBody.php +++ b/src/Models/Operations/DisableMFAResponseBody.php @@ -22,6 +22,7 @@ class DisableMFAResponseBody /** * @param ?string $userId + * @phpstan-pure */ public function __construct(?string $userId = null) { diff --git a/src/Models/Operations/File.php b/src/Models/Operations/File.php index a83f753..1fa51f2 100644 --- a/src/Models/Operations/File.php +++ b/src/Models/Operations/File.php @@ -28,6 +28,7 @@ class File /** * @param string $fileName * @param string $content + * @phpstan-pure */ public function __construct(string $fileName, string $content) { diff --git a/src/Models/Operations/GenerateSvixAuthURLResponse.php b/src/Models/Operations/GenerateSvixAuthURLResponse.php index 709a6fd..d39028b 100644 --- a/src/Models/Operations/GenerateSvixAuthURLResponse.php +++ b/src/Models/Operations/GenerateSvixAuthURLResponse.php @@ -44,6 +44,7 @@ class GenerateSvixAuthURLResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SvixURL $svixURL + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SvixURL $svixURL = null) { diff --git a/src/Models/Operations/GetClientListRequest.php b/src/Models/Operations/GetClientListRequest.php index 7379e90..d33831f 100644 --- a/src/Models/Operations/GetClientListRequest.php +++ b/src/Models/Operations/GetClientListRequest.php @@ -35,6 +35,7 @@ class GetClientListRequest /** * @param ?int $limit * @param ?int $offset + * @phpstan-pure */ public function __construct(?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/GetClientListResponse.php b/src/Models/Operations/GetClientListResponse.php index 10e3d32..0be016c 100644 --- a/src/Models/Operations/GetClientListResponse.php +++ b/src/Models/Operations/GetClientListResponse.php @@ -44,6 +44,7 @@ class GetClientListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $clientList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $clientList = null) { diff --git a/src/Models/Operations/GetClientRequest.php b/src/Models/Operations/GetClientRequest.php index 4d3db3f..f235fe4 100644 --- a/src/Models/Operations/GetClientRequest.php +++ b/src/Models/Operations/GetClientRequest.php @@ -21,6 +21,7 @@ class GetClientRequest /** * @param string $clientId + * @phpstan-pure */ public function __construct(string $clientId) { diff --git a/src/Models/Operations/GetClientResponse.php b/src/Models/Operations/GetClientResponse.php index fa67cbc..4a50aea 100644 --- a/src/Models/Operations/GetClientResponse.php +++ b/src/Models/Operations/GetClientResponse.php @@ -44,6 +44,7 @@ class GetClientResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Client $client + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Client $client = null) { diff --git a/src/Models/Operations/GetEmailAddressRequest.php b/src/Models/Operations/GetEmailAddressRequest.php index e24cb75..830465d 100644 --- a/src/Models/Operations/GetEmailAddressRequest.php +++ b/src/Models/Operations/GetEmailAddressRequest.php @@ -21,6 +21,7 @@ class GetEmailAddressRequest /** * @param string $emailAddressId + * @phpstan-pure */ public function __construct(string $emailAddressId) { diff --git a/src/Models/Operations/GetEmailAddressResponse.php b/src/Models/Operations/GetEmailAddressResponse.php index f976926..9be3663 100644 --- a/src/Models/Operations/GetEmailAddressResponse.php +++ b/src/Models/Operations/GetEmailAddressResponse.php @@ -44,6 +44,7 @@ class GetEmailAddressResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\EmailAddress $emailAddress + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\EmailAddress $emailAddress = null) { diff --git a/src/Models/Operations/GetInstanceResponse.php b/src/Models/Operations/GetInstanceResponse.php index 461eea2..653a60a 100644 --- a/src/Models/Operations/GetInstanceResponse.php +++ b/src/Models/Operations/GetInstanceResponse.php @@ -44,6 +44,7 @@ class GetInstanceResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Instance $instance + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Instance $instance = null) { diff --git a/src/Models/Operations/GetJWKSResponse.php b/src/Models/Operations/GetJWKSResponse.php index 16a6ba5..7c6a421 100644 --- a/src/Models/Operations/GetJWKSResponse.php +++ b/src/Models/Operations/GetJWKSResponse.php @@ -44,6 +44,7 @@ class GetJWKSResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Jwks $jwks + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Jwks $jwks = null) { diff --git a/src/Models/Operations/GetJWTTemplateRequest.php b/src/Models/Operations/GetJWTTemplateRequest.php index 12ecb7a..76cb208 100644 --- a/src/Models/Operations/GetJWTTemplateRequest.php +++ b/src/Models/Operations/GetJWTTemplateRequest.php @@ -21,6 +21,7 @@ class GetJWTTemplateRequest /** * @param string $templateId + * @phpstan-pure */ public function __construct(string $templateId) { diff --git a/src/Models/Operations/GetJWTTemplateResponse.php b/src/Models/Operations/GetJWTTemplateResponse.php index 1c5a8dd..8c1c7b1 100644 --- a/src/Models/Operations/GetJWTTemplateResponse.php +++ b/src/Models/Operations/GetJWTTemplateResponse.php @@ -44,6 +44,7 @@ class GetJWTTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\JWTTemplate $jwtTemplate + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\JWTTemplate $jwtTemplate = null) { diff --git a/src/Models/Operations/GetOAuthAccessTokenRequest.php b/src/Models/Operations/GetOAuthAccessTokenRequest.php index bc8674d..3329988 100644 --- a/src/Models/Operations/GetOAuthAccessTokenRequest.php +++ b/src/Models/Operations/GetOAuthAccessTokenRequest.php @@ -30,6 +30,7 @@ class GetOAuthAccessTokenRequest /** * @param string $userId * @param string $provider + * @phpstan-pure */ public function __construct(string $userId, string $provider) { diff --git a/src/Models/Operations/GetOAuthAccessTokenResponse.php b/src/Models/Operations/GetOAuthAccessTokenResponse.php index 1179414..497c1ae 100644 --- a/src/Models/Operations/GetOAuthAccessTokenResponse.php +++ b/src/Models/Operations/GetOAuthAccessTokenResponse.php @@ -44,6 +44,7 @@ class GetOAuthAccessTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $responseBodies + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $responseBodies = null) { diff --git a/src/Models/Operations/GetOAuthApplicationRequest.php b/src/Models/Operations/GetOAuthApplicationRequest.php index 949d29a..8aae16b 100644 --- a/src/Models/Operations/GetOAuthApplicationRequest.php +++ b/src/Models/Operations/GetOAuthApplicationRequest.php @@ -21,6 +21,7 @@ class GetOAuthApplicationRequest /** * @param string $oauthApplicationId + * @phpstan-pure */ public function __construct(string $oauthApplicationId) { diff --git a/src/Models/Operations/GetOAuthApplicationResponse.php b/src/Models/Operations/GetOAuthApplicationResponse.php index 01e2cf8..b364955 100644 --- a/src/Models/Operations/GetOAuthApplicationResponse.php +++ b/src/Models/Operations/GetOAuthApplicationResponse.php @@ -44,6 +44,7 @@ class GetOAuthApplicationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OAuthApplication $oAuthApplication + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OAuthApplication $oAuthApplication = null) { diff --git a/src/Models/Operations/GetOrganizationInvitationRequest.php b/src/Models/Operations/GetOrganizationInvitationRequest.php index f9579b2..f6e8b62 100644 --- a/src/Models/Operations/GetOrganizationInvitationRequest.php +++ b/src/Models/Operations/GetOrganizationInvitationRequest.php @@ -30,6 +30,7 @@ class GetOrganizationInvitationRequest /** * @param string $organizationId * @param string $invitationId + * @phpstan-pure */ public function __construct(string $organizationId, string $invitationId) { diff --git a/src/Models/Operations/GetOrganizationInvitationResponse.php b/src/Models/Operations/GetOrganizationInvitationResponse.php index 5544dc0..0d0ca81 100644 --- a/src/Models/Operations/GetOrganizationInvitationResponse.php +++ b/src/Models/Operations/GetOrganizationInvitationResponse.php @@ -44,6 +44,7 @@ class GetOrganizationInvitationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitation $organizationInvitation + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitation $organizationInvitation = null) { diff --git a/src/Models/Operations/GetOrganizationRequest.php b/src/Models/Operations/GetOrganizationRequest.php index 1fc6002..e9528e5 100644 --- a/src/Models/Operations/GetOrganizationRequest.php +++ b/src/Models/Operations/GetOrganizationRequest.php @@ -30,6 +30,7 @@ class GetOrganizationRequest /** * @param string $organizationId * @param ?bool $includeMembersCount + * @phpstan-pure */ public function __construct(string $organizationId, ?bool $includeMembersCount = null) { diff --git a/src/Models/Operations/GetOrganizationResponse.php b/src/Models/Operations/GetOrganizationResponse.php index b79c622..b6dec66 100644 --- a/src/Models/Operations/GetOrganizationResponse.php +++ b/src/Models/Operations/GetOrganizationResponse.php @@ -44,6 +44,7 @@ class GetOrganizationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/GetPhoneNumberRequest.php b/src/Models/Operations/GetPhoneNumberRequest.php index c40f8d3..115936d 100644 --- a/src/Models/Operations/GetPhoneNumberRequest.php +++ b/src/Models/Operations/GetPhoneNumberRequest.php @@ -21,6 +21,7 @@ class GetPhoneNumberRequest /** * @param string $phoneNumberId + * @phpstan-pure */ public function __construct(string $phoneNumberId) { diff --git a/src/Models/Operations/GetPhoneNumberResponse.php b/src/Models/Operations/GetPhoneNumberResponse.php index 65ddebe..8f3c1df 100644 --- a/src/Models/Operations/GetPhoneNumberResponse.php +++ b/src/Models/Operations/GetPhoneNumberResponse.php @@ -44,6 +44,7 @@ class GetPhoneNumberResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\PhoneNumber $phoneNumber + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\PhoneNumber $phoneNumber = null) { diff --git a/src/Models/Operations/GetPublicInterstitialRequest.php b/src/Models/Operations/GetPublicInterstitialRequest.php index 880ebda..2621d68 100644 --- a/src/Models/Operations/GetPublicInterstitialRequest.php +++ b/src/Models/Operations/GetPublicInterstitialRequest.php @@ -30,6 +30,7 @@ class GetPublicInterstitialRequest /** * @param ?string $frontendApi * @param ?string $publishableKey + * @phpstan-pure */ public function __construct(?string $frontendApi = null, ?string $publishableKey = null) { diff --git a/src/Models/Operations/GetPublicInterstitialResponse.php b/src/Models/Operations/GetPublicInterstitialResponse.php index dbd8863..ae0a59a 100644 --- a/src/Models/Operations/GetPublicInterstitialResponse.php +++ b/src/Models/Operations/GetPublicInterstitialResponse.php @@ -36,6 +36,7 @@ class GetPublicInterstitialResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/GetRedirectURLRequest.php b/src/Models/Operations/GetRedirectURLRequest.php index d37428c..394bdbf 100644 --- a/src/Models/Operations/GetRedirectURLRequest.php +++ b/src/Models/Operations/GetRedirectURLRequest.php @@ -21,6 +21,7 @@ class GetRedirectURLRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/GetRedirectURLResponse.php b/src/Models/Operations/GetRedirectURLResponse.php index 5440aa0..815199f 100644 --- a/src/Models/Operations/GetRedirectURLResponse.php +++ b/src/Models/Operations/GetRedirectURLResponse.php @@ -44,6 +44,7 @@ class GetRedirectURLResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\RedirectURL $redirectURL + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\RedirectURL $redirectURL = null) { diff --git a/src/Models/Operations/GetSAMLConnectionRequest.php b/src/Models/Operations/GetSAMLConnectionRequest.php index b47eea3..5a521c3 100644 --- a/src/Models/Operations/GetSAMLConnectionRequest.php +++ b/src/Models/Operations/GetSAMLConnectionRequest.php @@ -21,6 +21,7 @@ class GetSAMLConnectionRequest /** * @param string $samlConnectionId + * @phpstan-pure */ public function __construct(string $samlConnectionId) { diff --git a/src/Models/Operations/GetSAMLConnectionResponse.php b/src/Models/Operations/GetSAMLConnectionResponse.php index 3f59e63..f276bae 100644 --- a/src/Models/Operations/GetSAMLConnectionResponse.php +++ b/src/Models/Operations/GetSAMLConnectionResponse.php @@ -44,6 +44,7 @@ class GetSAMLConnectionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SchemasSAMLConnection $schemasSAMLConnection + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SchemasSAMLConnection $schemasSAMLConnection = null) { diff --git a/src/Models/Operations/GetSessionListRequest.php b/src/Models/Operations/GetSessionListRequest.php index 6605781..9b04022 100644 --- a/src/Models/Operations/GetSessionListRequest.php +++ b/src/Models/Operations/GetSessionListRequest.php @@ -62,6 +62,7 @@ class GetSessionListRequest * @param ?Status $status * @param ?int $limit * @param ?int $offset + * @phpstan-pure */ public function __construct(?string $clientId = null, ?string $userId = null, ?Status $status = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/GetSessionListResponse.php b/src/Models/Operations/GetSessionListResponse.php index 0b12959..6987a19 100644 --- a/src/Models/Operations/GetSessionListResponse.php +++ b/src/Models/Operations/GetSessionListResponse.php @@ -44,6 +44,7 @@ class GetSessionListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $sessionList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $sessionList = null) { diff --git a/src/Models/Operations/GetSessionRequest.php b/src/Models/Operations/GetSessionRequest.php index d6bff0b..c004185 100644 --- a/src/Models/Operations/GetSessionRequest.php +++ b/src/Models/Operations/GetSessionRequest.php @@ -21,6 +21,7 @@ class GetSessionRequest /** * @param string $sessionId + * @phpstan-pure */ public function __construct(string $sessionId) { diff --git a/src/Models/Operations/GetSessionResponse.php b/src/Models/Operations/GetSessionResponse.php index f5443f6..5e3efd7 100644 --- a/src/Models/Operations/GetSessionResponse.php +++ b/src/Models/Operations/GetSessionResponse.php @@ -44,6 +44,7 @@ class GetSessionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Session $session + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Session $session = null) { diff --git a/src/Models/Operations/GetTemplateListRequest.php b/src/Models/Operations/GetTemplateListRequest.php index dc7a268..64e6dc4 100644 --- a/src/Models/Operations/GetTemplateListRequest.php +++ b/src/Models/Operations/GetTemplateListRequest.php @@ -21,6 +21,7 @@ class GetTemplateListRequest /** * @param TemplateType $templateType + * @phpstan-pure */ public function __construct(TemplateType $templateType) { diff --git a/src/Models/Operations/GetTemplateListResponse.php b/src/Models/Operations/GetTemplateListResponse.php index 8fc4e42..4ea2c7f 100644 --- a/src/Models/Operations/GetTemplateListResponse.php +++ b/src/Models/Operations/GetTemplateListResponse.php @@ -44,6 +44,7 @@ class GetTemplateListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $templateList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $templateList = null) { diff --git a/src/Models/Operations/GetTemplateRequest.php b/src/Models/Operations/GetTemplateRequest.php index 3208f9a..0f42bc4 100644 --- a/src/Models/Operations/GetTemplateRequest.php +++ b/src/Models/Operations/GetTemplateRequest.php @@ -30,6 +30,7 @@ class GetTemplateRequest /** * @param PathParamTemplateType $templateType * @param string $slug + * @phpstan-pure */ public function __construct(PathParamTemplateType $templateType, string $slug) { diff --git a/src/Models/Operations/GetTemplateResponse.php b/src/Models/Operations/GetTemplateResponse.php index 2c8be49..19d40f5 100644 --- a/src/Models/Operations/GetTemplateResponse.php +++ b/src/Models/Operations/GetTemplateResponse.php @@ -44,6 +44,7 @@ class GetTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Template $template + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Template $template = null) { diff --git a/src/Models/Operations/GetUserListRequest.php b/src/Models/Operations/GetUserListRequest.php index 4d182c4..bbc75e1 100644 --- a/src/Models/Operations/GetUserListRequest.php +++ b/src/Models/Operations/GetUserListRequest.php @@ -149,6 +149,14 @@ class GetUserListRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=name_query')] public ?string $nameQuery = null; + /** + * Returns users which are either banned (`banned=true`) or not banned (`banned=false`). + * + * @var ?bool $banned + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=banned')] + public ?bool $banned = null; + /** * Returns users whose last session activity was before the given date (with millisecond precision). * @@ -249,6 +257,7 @@ class GetUserListRequest * @param ?string $phoneNumberQuery * @param ?string $usernameQuery * @param ?string $nameQuery + * @param ?bool $banned * @param ?int $lastActiveAtBefore * @param ?int $lastActiveAtAfter * @param ?int $lastActiveAtSince @@ -257,8 +266,9 @@ class GetUserListRequest * @param ?int $limit * @param ?int $offset * @param ?string $orderBy + * @phpstan-pure */ - public function __construct(?array $emailAddress = null, ?array $phoneNumber = null, ?array $externalId = null, ?array $username = null, ?array $web3Wallet = null, ?array $userId = null, ?array $organizationId = null, ?string $query = null, ?string $emailAddressQuery = null, ?string $phoneNumberQuery = null, ?string $usernameQuery = null, ?string $nameQuery = null, ?int $lastActiveAtBefore = null, ?int $lastActiveAtAfter = null, ?int $lastActiveAtSince = null, ?int $createdAtBefore = null, ?int $createdAtAfter = null, ?int $limit = 10, ?int $offset = 0, ?string $orderBy = '-created_at') + public function __construct(?array $emailAddress = null, ?array $phoneNumber = null, ?array $externalId = null, ?array $username = null, ?array $web3Wallet = null, ?array $userId = null, ?array $organizationId = null, ?string $query = null, ?string $emailAddressQuery = null, ?string $phoneNumberQuery = null, ?string $usernameQuery = null, ?string $nameQuery = null, ?bool $banned = null, ?int $lastActiveAtBefore = null, ?int $lastActiveAtAfter = null, ?int $lastActiveAtSince = null, ?int $createdAtBefore = null, ?int $createdAtAfter = null, ?int $limit = 10, ?int $offset = 0, ?string $orderBy = '-created_at') { $this->emailAddress = $emailAddress; $this->phoneNumber = $phoneNumber; @@ -272,6 +282,7 @@ public function __construct(?array $emailAddress = null, ?array $phoneNumber = n $this->phoneNumberQuery = $phoneNumberQuery; $this->usernameQuery = $usernameQuery; $this->nameQuery = $nameQuery; + $this->banned = $banned; $this->lastActiveAtBefore = $lastActiveAtBefore; $this->lastActiveAtAfter = $lastActiveAtAfter; $this->lastActiveAtSince = $lastActiveAtSince; diff --git a/src/Models/Operations/GetUserListResponse.php b/src/Models/Operations/GetUserListResponse.php index 0230b57..3588213 100644 --- a/src/Models/Operations/GetUserListResponse.php +++ b/src/Models/Operations/GetUserListResponse.php @@ -44,6 +44,7 @@ class GetUserListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $userList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $userList = null) { diff --git a/src/Models/Operations/GetUserRequest.php b/src/Models/Operations/GetUserRequest.php index 598bb64..3fbf841 100644 --- a/src/Models/Operations/GetUserRequest.php +++ b/src/Models/Operations/GetUserRequest.php @@ -21,6 +21,7 @@ class GetUserRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/GetUserResponse.php b/src/Models/Operations/GetUserResponse.php index d0c45ec..927f2f9 100644 --- a/src/Models/Operations/GetUserResponse.php +++ b/src/Models/Operations/GetUserResponse.php @@ -44,6 +44,7 @@ class GetUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/GetUsersCountRequest.php b/src/Models/Operations/GetUsersCountRequest.php index c00ff8f..4f9d568 100644 --- a/src/Models/Operations/GetUsersCountRequest.php +++ b/src/Models/Operations/GetUsersCountRequest.php @@ -121,6 +121,14 @@ class GetUsersCountRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=username_query')] public ?string $usernameQuery = null; + /** + * Counts users which are either banned (`banned=true`) or not banned (`banned=false`). + * + * @var ?bool $banned + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=banned')] + public ?bool $banned = null; + /** * @param ?array $emailAddress * @param ?array $phoneNumber @@ -132,8 +140,10 @@ class GetUsersCountRequest * @param ?string $emailAddressQuery * @param ?string $phoneNumberQuery * @param ?string $usernameQuery + * @param ?bool $banned + * @phpstan-pure */ - public function __construct(?array $emailAddress = null, ?array $phoneNumber = null, ?array $externalId = null, ?array $username = null, ?array $web3Wallet = null, ?array $userId = null, ?string $query = null, ?string $emailAddressQuery = null, ?string $phoneNumberQuery = null, ?string $usernameQuery = null) + public function __construct(?array $emailAddress = null, ?array $phoneNumber = null, ?array $externalId = null, ?array $username = null, ?array $web3Wallet = null, ?array $userId = null, ?string $query = null, ?string $emailAddressQuery = null, ?string $phoneNumberQuery = null, ?string $usernameQuery = null, ?bool $banned = null) { $this->emailAddress = $emailAddress; $this->phoneNumber = $phoneNumber; @@ -145,5 +155,6 @@ public function __construct(?array $emailAddress = null, ?array $phoneNumber = n $this->emailAddressQuery = $emailAddressQuery; $this->phoneNumberQuery = $phoneNumberQuery; $this->usernameQuery = $usernameQuery; + $this->banned = $banned; } } \ No newline at end of file diff --git a/src/Models/Operations/GetUsersCountResponse.php b/src/Models/Operations/GetUsersCountResponse.php index db28b6d..7936cb8 100644 --- a/src/Models/Operations/GetUsersCountResponse.php +++ b/src/Models/Operations/GetUsersCountResponse.php @@ -44,6 +44,7 @@ class GetUsersCountResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\TotalCount $totalCount + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\TotalCount $totalCount = null) { diff --git a/src/Models/Operations/InstanceGetOrganizationMembershipsRequest.php b/src/Models/Operations/InstanceGetOrganizationMembershipsRequest.php index b315dc7..089533d 100644 --- a/src/Models/Operations/InstanceGetOrganizationMembershipsRequest.php +++ b/src/Models/Operations/InstanceGetOrganizationMembershipsRequest.php @@ -47,6 +47,7 @@ class InstanceGetOrganizationMembershipsRequest * @param ?int $limit * @param ?int $offset * @param ?string $orderBy + * @phpstan-pure */ public function __construct(?string $orderBy = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/InstanceGetOrganizationMembershipsResponse.php b/src/Models/Operations/InstanceGetOrganizationMembershipsResponse.php index 87610e2..bd99108 100644 --- a/src/Models/Operations/InstanceGetOrganizationMembershipsResponse.php +++ b/src/Models/Operations/InstanceGetOrganizationMembershipsResponse.php @@ -44,6 +44,7 @@ class InstanceGetOrganizationMembershipsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationMemberships $organizationMemberships + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationMemberships $organizationMemberships = null) { diff --git a/src/Models/Operations/ListAllowlistIdentifiersResponse.php b/src/Models/Operations/ListAllowlistIdentifiersResponse.php index b8604fa..ed5ed4b 100644 --- a/src/Models/Operations/ListAllowlistIdentifiersResponse.php +++ b/src/Models/Operations/ListAllowlistIdentifiersResponse.php @@ -44,6 +44,7 @@ class ListAllowlistIdentifiersResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $allowlistIdentifierList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $allowlistIdentifierList = null) { diff --git a/src/Models/Operations/ListBlocklistIdentifiersResponse.php b/src/Models/Operations/ListBlocklistIdentifiersResponse.php index 76bb712..c387109 100644 --- a/src/Models/Operations/ListBlocklistIdentifiersResponse.php +++ b/src/Models/Operations/ListBlocklistIdentifiersResponse.php @@ -44,6 +44,7 @@ class ListBlocklistIdentifiersResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\BlocklistIdentifiers $blocklistIdentifiers + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\BlocklistIdentifiers $blocklistIdentifiers = null) { diff --git a/src/Models/Operations/ListDomainsResponse.php b/src/Models/Operations/ListDomainsResponse.php index 490d9cf..f2cbfaf 100644 --- a/src/Models/Operations/ListDomainsResponse.php +++ b/src/Models/Operations/ListDomainsResponse.php @@ -44,6 +44,7 @@ class ListDomainsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Domains $domains + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Domains $domains = null) { diff --git a/src/Models/Operations/ListInstanceOrganizationInvitationsRequest.php b/src/Models/Operations/ListInstanceOrganizationInvitationsRequest.php index 3313935..ba1eb9e 100644 --- a/src/Models/Operations/ListInstanceOrganizationInvitationsRequest.php +++ b/src/Models/Operations/ListInstanceOrganizationInvitationsRequest.php @@ -68,6 +68,7 @@ class ListInstanceOrganizationInvitationsRequest * @param ?string $orderBy * @param ?ListInstanceOrganizationInvitationsQueryParamStatus $status * @param ?string $query + * @phpstan-pure */ public function __construct(?ListInstanceOrganizationInvitationsQueryParamStatus $status = null, ?string $query = null, ?int $limit = 10, ?int $offset = 0, ?string $orderBy = '-created_at') { diff --git a/src/Models/Operations/ListInstanceOrganizationInvitationsResponse.php b/src/Models/Operations/ListInstanceOrganizationInvitationsResponse.php index e687220..be05905 100644 --- a/src/Models/Operations/ListInstanceOrganizationInvitationsResponse.php +++ b/src/Models/Operations/ListInstanceOrganizationInvitationsResponse.php @@ -44,6 +44,7 @@ class ListInstanceOrganizationInvitationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitationsWithPublicOrganizationData $organizationInvitationsWithPublicOrganizationData + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitationsWithPublicOrganizationData $organizationInvitationsWithPublicOrganizationData = null) { diff --git a/src/Models/Operations/ListInvitationsRequest.php b/src/Models/Operations/ListInvitationsRequest.php index 90e6ff4..59f1566 100644 --- a/src/Models/Operations/ListInvitationsRequest.php +++ b/src/Models/Operations/ListInvitationsRequest.php @@ -53,6 +53,7 @@ class ListInvitationsRequest * @param ?int $offset * @param ?ListInvitationsQueryParamStatus $status * @param ?string $query + * @phpstan-pure */ public function __construct(?ListInvitationsQueryParamStatus $status = null, ?string $query = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/ListInvitationsResponse.php b/src/Models/Operations/ListInvitationsResponse.php index dfa90e9..ce2d0e6 100644 --- a/src/Models/Operations/ListInvitationsResponse.php +++ b/src/Models/Operations/ListInvitationsResponse.php @@ -44,6 +44,7 @@ class ListInvitationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $invitationList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $invitationList = null) { diff --git a/src/Models/Operations/ListJWTTemplatesResponse.php b/src/Models/Operations/ListJWTTemplatesResponse.php index f412c53..f94eab2 100644 --- a/src/Models/Operations/ListJWTTemplatesResponse.php +++ b/src/Models/Operations/ListJWTTemplatesResponse.php @@ -44,6 +44,7 @@ class ListJWTTemplatesResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $jwtTemplateList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $jwtTemplateList = null) { diff --git a/src/Models/Operations/ListOAuthApplicationsRequest.php b/src/Models/Operations/ListOAuthApplicationsRequest.php index ae44a0e..63dbbd7 100644 --- a/src/Models/Operations/ListOAuthApplicationsRequest.php +++ b/src/Models/Operations/ListOAuthApplicationsRequest.php @@ -35,6 +35,7 @@ class ListOAuthApplicationsRequest /** * @param ?int $limit * @param ?int $offset + * @phpstan-pure */ public function __construct(?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/ListOAuthApplicationsResponse.php b/src/Models/Operations/ListOAuthApplicationsResponse.php index 228dd91..2414f12 100644 --- a/src/Models/Operations/ListOAuthApplicationsResponse.php +++ b/src/Models/Operations/ListOAuthApplicationsResponse.php @@ -44,6 +44,7 @@ class ListOAuthApplicationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OAuthApplications $oAuthApplications + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OAuthApplications $oAuthApplications = null) { diff --git a/src/Models/Operations/ListOrganizationDomainsRequest.php b/src/Models/Operations/ListOrganizationDomainsRequest.php index 7918949..39914de 100644 --- a/src/Models/Operations/ListOrganizationDomainsRequest.php +++ b/src/Models/Operations/ListOrganizationDomainsRequest.php @@ -62,6 +62,7 @@ class ListOrganizationDomainsRequest * @param ?int $offset * @param ?string $verified * @param ?string $enrollmentMode + * @phpstan-pure */ public function __construct(string $organizationId, ?string $verified = null, ?string $enrollmentMode = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/ListOrganizationDomainsResponse.php b/src/Models/Operations/ListOrganizationDomainsResponse.php index b8ced1c..ad95f4c 100644 --- a/src/Models/Operations/ListOrganizationDomainsResponse.php +++ b/src/Models/Operations/ListOrganizationDomainsResponse.php @@ -44,6 +44,7 @@ class ListOrganizationDomainsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationDomains $organizationDomains + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationDomains $organizationDomains = null) { diff --git a/src/Models/Operations/ListOrganizationInvitationsRequest.php b/src/Models/Operations/ListOrganizationInvitationsRequest.php index ad7d3c7..5c58295 100644 --- a/src/Models/Operations/ListOrganizationInvitationsRequest.php +++ b/src/Models/Operations/ListOrganizationInvitationsRequest.php @@ -53,6 +53,7 @@ class ListOrganizationInvitationsRequest * @param ?int $limit * @param ?int $offset * @param ?ListOrganizationInvitationsQueryParamStatus $status + * @phpstan-pure */ public function __construct(string $organizationId, ?ListOrganizationInvitationsQueryParamStatus $status = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/ListOrganizationInvitationsResponse.php b/src/Models/Operations/ListOrganizationInvitationsResponse.php index c47c874..b5a7996 100644 --- a/src/Models/Operations/ListOrganizationInvitationsResponse.php +++ b/src/Models/Operations/ListOrganizationInvitationsResponse.php @@ -44,6 +44,7 @@ class ListOrganizationInvitationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitations $organizationInvitations + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitations $organizationInvitations = null) { diff --git a/src/Models/Operations/ListOrganizationMembershipsRequest.php b/src/Models/Operations/ListOrganizationMembershipsRequest.php index 3e81c4a..5960c21 100644 --- a/src/Models/Operations/ListOrganizationMembershipsRequest.php +++ b/src/Models/Operations/ListOrganizationMembershipsRequest.php @@ -56,6 +56,7 @@ class ListOrganizationMembershipsRequest * @param ?int $limit * @param ?int $offset * @param ?string $orderBy + * @phpstan-pure */ public function __construct(string $organizationId, ?string $orderBy = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/ListOrganizationMembershipsResponse.php b/src/Models/Operations/ListOrganizationMembershipsResponse.php index a6f07a2..a83f1e6 100644 --- a/src/Models/Operations/ListOrganizationMembershipsResponse.php +++ b/src/Models/Operations/ListOrganizationMembershipsResponse.php @@ -44,6 +44,7 @@ class ListOrganizationMembershipsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationMemberships $organizationMemberships + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationMemberships $organizationMemberships = null) { diff --git a/src/Models/Operations/ListOrganizationsRequest.php b/src/Models/Operations/ListOrganizationsRequest.php index 83042ec..f09e68d 100644 --- a/src/Models/Operations/ListOrganizationsRequest.php +++ b/src/Models/Operations/ListOrganizationsRequest.php @@ -70,6 +70,7 @@ class ListOrganizationsRequest * @param ?bool $includeMembersCount * @param ?string $query * @param ?string $orderBy + * @phpstan-pure */ public function __construct(?bool $includeMembersCount = null, ?string $query = null, ?int $limit = 10, ?int $offset = 0, ?string $orderBy = '-created_at') { diff --git a/src/Models/Operations/ListOrganizationsResponse.php b/src/Models/Operations/ListOrganizationsResponse.php index ebacf11..ff00882 100644 --- a/src/Models/Operations/ListOrganizationsResponse.php +++ b/src/Models/Operations/ListOrganizationsResponse.php @@ -44,6 +44,7 @@ class ListOrganizationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organizations $organizations + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organizations $organizations = null) { diff --git a/src/Models/Operations/ListPendingOrganizationInvitationsRequest.php b/src/Models/Operations/ListPendingOrganizationInvitationsRequest.php index 1a1e929..2400dd6 100644 --- a/src/Models/Operations/ListPendingOrganizationInvitationsRequest.php +++ b/src/Models/Operations/ListPendingOrganizationInvitationsRequest.php @@ -44,6 +44,7 @@ class ListPendingOrganizationInvitationsRequest * @param string $organizationId * @param ?int $limit * @param ?int $offset + * @phpstan-pure */ public function __construct(string $organizationId, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/ListPendingOrganizationInvitationsResponse.php b/src/Models/Operations/ListPendingOrganizationInvitationsResponse.php index 84d021c..ffc180f 100644 --- a/src/Models/Operations/ListPendingOrganizationInvitationsResponse.php +++ b/src/Models/Operations/ListPendingOrganizationInvitationsResponse.php @@ -44,6 +44,7 @@ class ListPendingOrganizationInvitationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitations $organizationInvitations + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitations $organizationInvitations = null) { diff --git a/src/Models/Operations/ListRedirectURLsResponse.php b/src/Models/Operations/ListRedirectURLsResponse.php index 83876c6..6a83a59 100644 --- a/src/Models/Operations/ListRedirectURLsResponse.php +++ b/src/Models/Operations/ListRedirectURLsResponse.php @@ -44,6 +44,7 @@ class ListRedirectURLsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?array $redirectURLList + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $redirectURLList = null) { diff --git a/src/Models/Operations/ListSAMLConnectionsRequest.php b/src/Models/Operations/ListSAMLConnectionsRequest.php index 25bbbae..7e0e85a 100644 --- a/src/Models/Operations/ListSAMLConnectionsRequest.php +++ b/src/Models/Operations/ListSAMLConnectionsRequest.php @@ -51,6 +51,7 @@ class ListSAMLConnectionsRequest * @param ?int $limit * @param ?int $offset * @param ?array $organizationId + * @phpstan-pure */ public function __construct(?array $organizationId = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/ListSAMLConnectionsResponse.php b/src/Models/Operations/ListSAMLConnectionsResponse.php index f24028f..4b83d7c 100644 --- a/src/Models/Operations/ListSAMLConnectionsResponse.php +++ b/src/Models/Operations/ListSAMLConnectionsResponse.php @@ -44,6 +44,7 @@ class ListSAMLConnectionsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SAMLConnections $samlConnections + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SAMLConnections $samlConnections = null) { diff --git a/src/Models/Operations/ListWaitlistEntriesRequest.php b/src/Models/Operations/ListWaitlistEntriesRequest.php index 5990c98..e942223 100644 --- a/src/Models/Operations/ListWaitlistEntriesRequest.php +++ b/src/Models/Operations/ListWaitlistEntriesRequest.php @@ -68,6 +68,7 @@ class ListWaitlistEntriesRequest * @param ?string $query * @param ?ListWaitlistEntriesQueryParamStatus $status * @param ?string $orderBy + * @phpstan-pure */ public function __construct(?string $query = null, ?ListWaitlistEntriesQueryParamStatus $status = null, ?int $limit = 10, ?int $offset = 0, ?string $orderBy = '-created_at') { diff --git a/src/Models/Operations/ListWaitlistEntriesResponse.php b/src/Models/Operations/ListWaitlistEntriesResponse.php index 5f4bfba..f6d781b 100644 --- a/src/Models/Operations/ListWaitlistEntriesResponse.php +++ b/src/Models/Operations/ListWaitlistEntriesResponse.php @@ -44,6 +44,7 @@ class ListWaitlistEntriesResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\WaitlistEntries $waitlistEntries + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\WaitlistEntries $waitlistEntries = null) { diff --git a/src/Models/Operations/LockUserRequest.php b/src/Models/Operations/LockUserRequest.php index cd39c19..8c23618 100644 --- a/src/Models/Operations/LockUserRequest.php +++ b/src/Models/Operations/LockUserRequest.php @@ -21,6 +21,7 @@ class LockUserRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/LockUserResponse.php b/src/Models/Operations/LockUserResponse.php index a75e959..42da1ee 100644 --- a/src/Models/Operations/LockUserResponse.php +++ b/src/Models/Operations/LockUserResponse.php @@ -44,6 +44,7 @@ class LockUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/MergeOrganizationMetadataRequest.php b/src/Models/Operations/MergeOrganizationMetadataRequest.php index 6988a4f..5b88834 100644 --- a/src/Models/Operations/MergeOrganizationMetadataRequest.php +++ b/src/Models/Operations/MergeOrganizationMetadataRequest.php @@ -29,6 +29,7 @@ class MergeOrganizationMetadataRequest /** * @param string $organizationId * @param MergeOrganizationMetadataRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, MergeOrganizationMetadataRequestBody $requestBody) { diff --git a/src/Models/Operations/MergeOrganizationMetadataRequestBody.php b/src/Models/Operations/MergeOrganizationMetadataRequestBody.php index 9cb0957..0c4b710 100644 --- a/src/Models/Operations/MergeOrganizationMetadataRequestBody.php +++ b/src/Models/Operations/MergeOrganizationMetadataRequestBody.php @@ -38,6 +38,7 @@ class MergeOrganizationMetadataRequestBody /** * @param ?array $publicMetadata * @param ?array $privateMetadata + * @phpstan-pure */ public function __construct(?array $publicMetadata = null, ?array $privateMetadata = null) { diff --git a/src/Models/Operations/MergeOrganizationMetadataResponse.php b/src/Models/Operations/MergeOrganizationMetadataResponse.php index 1521af8..1f41507 100644 --- a/src/Models/Operations/MergeOrganizationMetadataResponse.php +++ b/src/Models/Operations/MergeOrganizationMetadataResponse.php @@ -44,6 +44,7 @@ class MergeOrganizationMetadataResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/PreviewTemplateRequest.php b/src/Models/Operations/PreviewTemplateRequest.php index 4e801f7..d1f993e 100644 --- a/src/Models/Operations/PreviewTemplateRequest.php +++ b/src/Models/Operations/PreviewTemplateRequest.php @@ -39,6 +39,7 @@ class PreviewTemplateRequest * @param string $templateType * @param string $slug * @param ?PreviewTemplateRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $templateType, string $slug, ?PreviewTemplateRequestBody $requestBody = null) { diff --git a/src/Models/Operations/PreviewTemplateRequestBody.php b/src/Models/Operations/PreviewTemplateRequestBody.php index 0369a6e..363db13 100644 --- a/src/Models/Operations/PreviewTemplateRequestBody.php +++ b/src/Models/Operations/PreviewTemplateRequestBody.php @@ -61,6 +61,7 @@ class PreviewTemplateRequestBody * @param ?string $fromEmailName * @param ?string $replyToEmailName * @param ?string $subject + * @phpstan-pure */ public function __construct(?string $body = null, ?string $fromEmailName = null, ?string $replyToEmailName = null, ?string $subject = null) { diff --git a/src/Models/Operations/PreviewTemplateResponse.php b/src/Models/Operations/PreviewTemplateResponse.php index 5166c6f..76497f2 100644 --- a/src/Models/Operations/PreviewTemplateResponse.php +++ b/src/Models/Operations/PreviewTemplateResponse.php @@ -44,6 +44,7 @@ class PreviewTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?PreviewTemplateResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?PreviewTemplateResponseBody $object = null) { diff --git a/src/Models/Operations/RequestBody.php b/src/Models/Operations/RequestBody.php index 09a72f5..d47f3f2 100644 --- a/src/Models/Operations/RequestBody.php +++ b/src/Models/Operations/RequestBody.php @@ -79,6 +79,7 @@ class RequestBody * @param ?bool $notify * @param ?bool $ignoreExisting * @param ?int $expiresInDays + * @phpstan-pure */ public function __construct(string $emailAddress, ?array $publicMetadata = null, ?string $redirectUrl = null, ?int $expiresInDays = null, ?bool $notify = true, ?bool $ignoreExisting = false) { diff --git a/src/Models/Operations/ResponseBody.php b/src/Models/Operations/ResponseBody.php index c7fcc16..e6f1d9f 100644 --- a/src/Models/Operations/ResponseBody.php +++ b/src/Models/Operations/ResponseBody.php @@ -114,6 +114,7 @@ class ResponseBody * @param ?string $tokenSecret * @param ?string $label * @param ?int $expiresAt + * @phpstan-pure */ public function __construct(?string $object = null, ?string $externalAccountId = null, ?string $providerUserId = null, ?string $token = null, ?string $provider = null, ?array $publicMetadata = null, ?array $scopes = null, ?string $tokenSecret = null, ?string $label = null, ?int $expiresAt = null) { diff --git a/src/Models/Operations/RevertTemplateRequest.php b/src/Models/Operations/RevertTemplateRequest.php index 831f0b1..839c933 100644 --- a/src/Models/Operations/RevertTemplateRequest.php +++ b/src/Models/Operations/RevertTemplateRequest.php @@ -30,6 +30,7 @@ class RevertTemplateRequest /** * @param RevertTemplatePathParamTemplateType $templateType * @param string $slug + * @phpstan-pure */ public function __construct(RevertTemplatePathParamTemplateType $templateType, string $slug) { diff --git a/src/Models/Operations/RevertTemplateResponse.php b/src/Models/Operations/RevertTemplateResponse.php index c56ca93..245332d 100644 --- a/src/Models/Operations/RevertTemplateResponse.php +++ b/src/Models/Operations/RevertTemplateResponse.php @@ -44,6 +44,7 @@ class RevertTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Template $template + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Template $template = null) { diff --git a/src/Models/Operations/RevokeActorTokenRequest.php b/src/Models/Operations/RevokeActorTokenRequest.php index 7f2d82a..28cea24 100644 --- a/src/Models/Operations/RevokeActorTokenRequest.php +++ b/src/Models/Operations/RevokeActorTokenRequest.php @@ -21,6 +21,7 @@ class RevokeActorTokenRequest /** * @param string $actorTokenId + * @phpstan-pure */ public function __construct(string $actorTokenId) { diff --git a/src/Models/Operations/RevokeActorTokenResponse.php b/src/Models/Operations/RevokeActorTokenResponse.php index f538761..e07dd11 100644 --- a/src/Models/Operations/RevokeActorTokenResponse.php +++ b/src/Models/Operations/RevokeActorTokenResponse.php @@ -44,6 +44,7 @@ class RevokeActorTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ActorToken $actorToken + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ActorToken $actorToken = null) { diff --git a/src/Models/Operations/RevokeInvitationRequest.php b/src/Models/Operations/RevokeInvitationRequest.php index 129f2c9..2324dcf 100644 --- a/src/Models/Operations/RevokeInvitationRequest.php +++ b/src/Models/Operations/RevokeInvitationRequest.php @@ -21,6 +21,7 @@ class RevokeInvitationRequest /** * @param string $invitationId + * @phpstan-pure */ public function __construct(string $invitationId) { diff --git a/src/Models/Operations/RevokeInvitationResponse.php b/src/Models/Operations/RevokeInvitationResponse.php index 4957b8e..19fb041 100644 --- a/src/Models/Operations/RevokeInvitationResponse.php +++ b/src/Models/Operations/RevokeInvitationResponse.php @@ -44,6 +44,7 @@ class RevokeInvitationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\InvitationRevoked $invitationRevoked + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\InvitationRevoked $invitationRevoked = null) { diff --git a/src/Models/Operations/RevokeOrganizationInvitationRequest.php b/src/Models/Operations/RevokeOrganizationInvitationRequest.php index 9d2f369..8f76f52 100644 --- a/src/Models/Operations/RevokeOrganizationInvitationRequest.php +++ b/src/Models/Operations/RevokeOrganizationInvitationRequest.php @@ -38,6 +38,7 @@ class RevokeOrganizationInvitationRequest * @param string $organizationId * @param string $invitationId * @param ?RevokeOrganizationInvitationRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, string $invitationId, ?RevokeOrganizationInvitationRequestBody $requestBody = null) { diff --git a/src/Models/Operations/RevokeOrganizationInvitationRequestBody.php b/src/Models/Operations/RevokeOrganizationInvitationRequestBody.php index 88499a3..a825cbc 100644 --- a/src/Models/Operations/RevokeOrganizationInvitationRequestBody.php +++ b/src/Models/Operations/RevokeOrganizationInvitationRequestBody.php @@ -24,6 +24,7 @@ class RevokeOrganizationInvitationRequestBody /** * @param ?string $requestingUserId + * @phpstan-pure */ public function __construct(?string $requestingUserId = null) { diff --git a/src/Models/Operations/RevokeOrganizationInvitationResponse.php b/src/Models/Operations/RevokeOrganizationInvitationResponse.php index b7ffc31..2bc70c6 100644 --- a/src/Models/Operations/RevokeOrganizationInvitationResponse.php +++ b/src/Models/Operations/RevokeOrganizationInvitationResponse.php @@ -44,6 +44,7 @@ class RevokeOrganizationInvitationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitation $organizationInvitation + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitation $organizationInvitation = null) { diff --git a/src/Models/Operations/RevokeSessionRequest.php b/src/Models/Operations/RevokeSessionRequest.php index d8b1e8f..21d492f 100644 --- a/src/Models/Operations/RevokeSessionRequest.php +++ b/src/Models/Operations/RevokeSessionRequest.php @@ -21,6 +21,7 @@ class RevokeSessionRequest /** * @param string $sessionId + * @phpstan-pure */ public function __construct(string $sessionId) { diff --git a/src/Models/Operations/RevokeSessionResponse.php b/src/Models/Operations/RevokeSessionResponse.php index da40c86..0d8c935 100644 --- a/src/Models/Operations/RevokeSessionResponse.php +++ b/src/Models/Operations/RevokeSessionResponse.php @@ -44,6 +44,7 @@ class RevokeSessionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Session $session + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Session $session = null) { diff --git a/src/Models/Operations/RevokeSignInTokenRequest.php b/src/Models/Operations/RevokeSignInTokenRequest.php index 5634650..8f15276 100644 --- a/src/Models/Operations/RevokeSignInTokenRequest.php +++ b/src/Models/Operations/RevokeSignInTokenRequest.php @@ -21,6 +21,7 @@ class RevokeSignInTokenRequest /** * @param string $signInTokenId + * @phpstan-pure */ public function __construct(string $signInTokenId) { diff --git a/src/Models/Operations/RevokeSignInTokenResponse.php b/src/Models/Operations/RevokeSignInTokenResponse.php index 38983dc..47cf2b3 100644 --- a/src/Models/Operations/RevokeSignInTokenResponse.php +++ b/src/Models/Operations/RevokeSignInTokenResponse.php @@ -44,6 +44,7 @@ class RevokeSignInTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SignInToken $signInToken + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SignInToken $signInToken = null) { diff --git a/src/Models/Operations/RotateOAuthApplicationSecretRequest.php b/src/Models/Operations/RotateOAuthApplicationSecretRequest.php index c19b74a..8a37e18 100644 --- a/src/Models/Operations/RotateOAuthApplicationSecretRequest.php +++ b/src/Models/Operations/RotateOAuthApplicationSecretRequest.php @@ -21,6 +21,7 @@ class RotateOAuthApplicationSecretRequest /** * @param string $oauthApplicationId + * @phpstan-pure */ public function __construct(string $oauthApplicationId) { diff --git a/src/Models/Operations/RotateOAuthApplicationSecretResponse.php b/src/Models/Operations/RotateOAuthApplicationSecretResponse.php index be5ac25..ff9f922 100644 --- a/src/Models/Operations/RotateOAuthApplicationSecretResponse.php +++ b/src/Models/Operations/RotateOAuthApplicationSecretResponse.php @@ -44,6 +44,7 @@ class RotateOAuthApplicationSecretResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OAuthApplicationWithSecret $oAuthApplicationWithSecret + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OAuthApplicationWithSecret $oAuthApplicationWithSecret = null) { diff --git a/src/Models/Operations/SetUserProfileImageRequest.php b/src/Models/Operations/SetUserProfileImageRequest.php index e1f07ec..ed9ce21 100644 --- a/src/Models/Operations/SetUserProfileImageRequest.php +++ b/src/Models/Operations/SetUserProfileImageRequest.php @@ -29,6 +29,7 @@ class SetUserProfileImageRequest /** * @param string $userId * @param SetUserProfileImageRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $userId, SetUserProfileImageRequestBody $requestBody) { diff --git a/src/Models/Operations/SetUserProfileImageRequestBody.php b/src/Models/Operations/SetUserProfileImageRequestBody.php index ce8d6a9..752fb82 100644 --- a/src/Models/Operations/SetUserProfileImageRequestBody.php +++ b/src/Models/Operations/SetUserProfileImageRequestBody.php @@ -20,6 +20,7 @@ class SetUserProfileImageRequestBody /** * @param ?File $file + * @phpstan-pure */ public function __construct(?File $file = null) { diff --git a/src/Models/Operations/SetUserProfileImageResponse.php b/src/Models/Operations/SetUserProfileImageResponse.php index 83fb630..5bc09c6 100644 --- a/src/Models/Operations/SetUserProfileImageResponse.php +++ b/src/Models/Operations/SetUserProfileImageResponse.php @@ -44,6 +44,7 @@ class SetUserProfileImageResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/ToggleTemplateDeliveryRequest.php b/src/Models/Operations/ToggleTemplateDeliveryRequest.php index 08cae67..098c8c1 100644 --- a/src/Models/Operations/ToggleTemplateDeliveryRequest.php +++ b/src/Models/Operations/ToggleTemplateDeliveryRequest.php @@ -38,6 +38,7 @@ class ToggleTemplateDeliveryRequest * @param ToggleTemplateDeliveryPathParamTemplateType $templateType * @param string $slug * @param ?ToggleTemplateDeliveryRequestBody $requestBody + * @phpstan-pure */ public function __construct(ToggleTemplateDeliveryPathParamTemplateType $templateType, string $slug, ?ToggleTemplateDeliveryRequestBody $requestBody = null) { diff --git a/src/Models/Operations/ToggleTemplateDeliveryRequestBody.php b/src/Models/Operations/ToggleTemplateDeliveryRequestBody.php index 4ad7892..02727a3 100644 --- a/src/Models/Operations/ToggleTemplateDeliveryRequestBody.php +++ b/src/Models/Operations/ToggleTemplateDeliveryRequestBody.php @@ -22,6 +22,7 @@ class ToggleTemplateDeliveryRequestBody /** * @param ?bool $deliveredByClerk + * @phpstan-pure */ public function __construct(?bool $deliveredByClerk = null) { diff --git a/src/Models/Operations/ToggleTemplateDeliveryResponse.php b/src/Models/Operations/ToggleTemplateDeliveryResponse.php index b5cb28b..1cd6c0d 100644 --- a/src/Models/Operations/ToggleTemplateDeliveryResponse.php +++ b/src/Models/Operations/ToggleTemplateDeliveryResponse.php @@ -44,6 +44,7 @@ class ToggleTemplateDeliveryResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Template $template + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Template $template = null) { diff --git a/src/Models/Operations/UnbanUserRequest.php b/src/Models/Operations/UnbanUserRequest.php index 73e9137..a8c769e 100644 --- a/src/Models/Operations/UnbanUserRequest.php +++ b/src/Models/Operations/UnbanUserRequest.php @@ -21,6 +21,7 @@ class UnbanUserRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/UnbanUserResponse.php b/src/Models/Operations/UnbanUserResponse.php index 717c504..1f1f2b6 100644 --- a/src/Models/Operations/UnbanUserResponse.php +++ b/src/Models/Operations/UnbanUserResponse.php @@ -44,6 +44,7 @@ class UnbanUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/UnlockUserRequest.php b/src/Models/Operations/UnlockUserRequest.php index 00992e7..93f6ac3 100644 --- a/src/Models/Operations/UnlockUserRequest.php +++ b/src/Models/Operations/UnlockUserRequest.php @@ -21,6 +21,7 @@ class UnlockUserRequest /** * @param string $userId + * @phpstan-pure */ public function __construct(string $userId) { diff --git a/src/Models/Operations/UnlockUserResponse.php b/src/Models/Operations/UnlockUserResponse.php index 9dea605..5ba64fb 100644 --- a/src/Models/Operations/UnlockUserResponse.php +++ b/src/Models/Operations/UnlockUserResponse.php @@ -44,6 +44,7 @@ class UnlockUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/UpdateDomainRequest.php b/src/Models/Operations/UpdateDomainRequest.php index 6992188..dd2443b 100644 --- a/src/Models/Operations/UpdateDomainRequest.php +++ b/src/Models/Operations/UpdateDomainRequest.php @@ -29,6 +29,7 @@ class UpdateDomainRequest /** * @param string $domainId * @param UpdateDomainRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $domainId, UpdateDomainRequestBody $requestBody) { diff --git a/src/Models/Operations/UpdateDomainRequestBody.php b/src/Models/Operations/UpdateDomainRequestBody.php index 0c43d22..b373620 100644 --- a/src/Models/Operations/UpdateDomainRequestBody.php +++ b/src/Models/Operations/UpdateDomainRequestBody.php @@ -50,6 +50,7 @@ class UpdateDomainRequestBody * @param ?string $name * @param ?string $proxyUrl * @param ?bool $isSecondary + * @phpstan-pure */ public function __construct(?string $name = null, ?string $proxyUrl = null, ?bool $isSecondary = null) { diff --git a/src/Models/Operations/UpdateDomainResponse.php b/src/Models/Operations/UpdateDomainResponse.php index 88fbbc3..e8e6026 100644 --- a/src/Models/Operations/UpdateDomainResponse.php +++ b/src/Models/Operations/UpdateDomainResponse.php @@ -44,6 +44,7 @@ class UpdateDomainResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Domain $domain + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Domain $domain = null) { diff --git a/src/Models/Operations/UpdateEmailAddressRequest.php b/src/Models/Operations/UpdateEmailAddressRequest.php index 69d7801..635a393 100644 --- a/src/Models/Operations/UpdateEmailAddressRequest.php +++ b/src/Models/Operations/UpdateEmailAddressRequest.php @@ -29,6 +29,7 @@ class UpdateEmailAddressRequest /** * @param string $emailAddressId * @param ?UpdateEmailAddressRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $emailAddressId, ?UpdateEmailAddressRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UpdateEmailAddressRequestBody.php b/src/Models/Operations/UpdateEmailAddressRequestBody.php index b8ca5a2..8347aa0 100644 --- a/src/Models/Operations/UpdateEmailAddressRequestBody.php +++ b/src/Models/Operations/UpdateEmailAddressRequestBody.php @@ -32,6 +32,7 @@ class UpdateEmailAddressRequestBody /** * @param ?bool $verified * @param ?bool $primary + * @phpstan-pure */ public function __construct(?bool $verified = null, ?bool $primary = null) { diff --git a/src/Models/Operations/UpdateEmailAddressResponse.php b/src/Models/Operations/UpdateEmailAddressResponse.php index 40b5de1..6459f84 100644 --- a/src/Models/Operations/UpdateEmailAddressResponse.php +++ b/src/Models/Operations/UpdateEmailAddressResponse.php @@ -44,6 +44,7 @@ class UpdateEmailAddressResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\EmailAddress $emailAddress + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\EmailAddress $emailAddress = null) { diff --git a/src/Models/Operations/UpdateInstanceAuthConfigRequestBody.php b/src/Models/Operations/UpdateInstanceAuthConfigRequestBody.php index d68fe59..a1a4191 100644 --- a/src/Models/Operations/UpdateInstanceAuthConfigRequestBody.php +++ b/src/Models/Operations/UpdateInstanceAuthConfigRequestBody.php @@ -79,6 +79,7 @@ class UpdateInstanceAuthConfigRequestBody * @param ?string $sessionTokenTemplate * @param ?bool $enhancedEmailDeliverability * @param ?bool $testMode + * @phpstan-pure */ public function __construct(?string $fromEmailAddress = null, ?bool $progressiveSignUp = null, ?string $sessionTokenTemplate = null, ?bool $enhancedEmailDeliverability = null, ?bool $testMode = null, ?bool $restrictedToAllowlist = false) { diff --git a/src/Models/Operations/UpdateInstanceAuthConfigResponse.php b/src/Models/Operations/UpdateInstanceAuthConfigResponse.php index e2ef0c4..0bd54c6 100644 --- a/src/Models/Operations/UpdateInstanceAuthConfigResponse.php +++ b/src/Models/Operations/UpdateInstanceAuthConfigResponse.php @@ -44,6 +44,7 @@ class UpdateInstanceAuthConfigResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\InstanceSettings $instanceSettings + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\InstanceSettings $instanceSettings = null) { diff --git a/src/Models/Operations/UpdateInstanceOrganizationSettingsRequestBody.php b/src/Models/Operations/UpdateInstanceOrganizationSettingsRequestBody.php index 68ebd53..6ba64be 100644 --- a/src/Models/Operations/UpdateInstanceOrganizationSettingsRequestBody.php +++ b/src/Models/Operations/UpdateInstanceOrganizationSettingsRequestBody.php @@ -81,6 +81,7 @@ class UpdateInstanceOrganizationSettingsRequestBody * @param ?int $maxAllowedMemberships * @param ?bool $adminDeleteEnabled * @param ?bool $domainsEnabled + * @phpstan-pure */ public function __construct(?array $domainsEnrollmentModes = null, ?string $creatorRoleId = null, ?string $domainsDefaultRoleId = null, ?bool $enabled = null, ?int $maxAllowedMemberships = null, ?bool $adminDeleteEnabled = null, ?bool $domainsEnabled = null) { diff --git a/src/Models/Operations/UpdateInstanceOrganizationSettingsResponse.php b/src/Models/Operations/UpdateInstanceOrganizationSettingsResponse.php index bdd94bf..df0f8e9 100644 --- a/src/Models/Operations/UpdateInstanceOrganizationSettingsResponse.php +++ b/src/Models/Operations/UpdateInstanceOrganizationSettingsResponse.php @@ -44,6 +44,7 @@ class UpdateInstanceOrganizationSettingsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationSettings $organizationSettings + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationSettings $organizationSettings = null) { diff --git a/src/Models/Operations/UpdateInstanceRequestBody.php b/src/Models/Operations/UpdateInstanceRequestBody.php index 4021db2..9281f15 100644 --- a/src/Models/Operations/UpdateInstanceRequestBody.php +++ b/src/Models/Operations/UpdateInstanceRequestBody.php @@ -109,6 +109,7 @@ class UpdateInstanceRequestBody * @param ?string $supportEmail * @param ?string $clerkJsVersion * @param ?string $developmentOrigin + * @phpstan-pure */ public function __construct(?array $allowedOrigins = null, ?bool $cookielessDev = null, ?bool $urlBasedSessionSyncing = null, ?bool $testMode = null, ?bool $hibp = null, ?bool $enhancedEmailDeliverability = null, ?string $supportEmail = null, ?string $clerkJsVersion = null, ?string $developmentOrigin = null) { diff --git a/src/Models/Operations/UpdateInstanceResponse.php b/src/Models/Operations/UpdateInstanceResponse.php index 12250d2..d3c5382 100644 --- a/src/Models/Operations/UpdateInstanceResponse.php +++ b/src/Models/Operations/UpdateInstanceResponse.php @@ -36,6 +36,7 @@ class UpdateInstanceResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/UpdateInstanceRestrictionsRequestBody.php b/src/Models/Operations/UpdateInstanceRestrictionsRequestBody.php index f823a24..b832ff6 100644 --- a/src/Models/Operations/UpdateInstanceRestrictionsRequestBody.php +++ b/src/Models/Operations/UpdateInstanceRestrictionsRequestBody.php @@ -57,6 +57,7 @@ class UpdateInstanceRestrictionsRequestBody * @param ?bool $blockEmailSubaddresses * @param ?bool $blockDisposableEmailDomains * @param ?bool $ignoreDotsForGmailAddresses + * @phpstan-pure */ public function __construct(?bool $allowlist = null, ?bool $blocklist = null, ?bool $blockEmailSubaddresses = null, ?bool $blockDisposableEmailDomains = null, ?bool $ignoreDotsForGmailAddresses = null) { diff --git a/src/Models/Operations/UpdateInstanceRestrictionsResponse.php b/src/Models/Operations/UpdateInstanceRestrictionsResponse.php index e4dbe4f..8acbc24 100644 --- a/src/Models/Operations/UpdateInstanceRestrictionsResponse.php +++ b/src/Models/Operations/UpdateInstanceRestrictionsResponse.php @@ -44,6 +44,7 @@ class UpdateInstanceRestrictionsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\InstanceRestrictions $instanceRestrictions + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\InstanceRestrictions $instanceRestrictions = null) { diff --git a/src/Models/Operations/UpdateJWTTemplateRequest.php b/src/Models/Operations/UpdateJWTTemplateRequest.php index 5001089..581838a 100644 --- a/src/Models/Operations/UpdateJWTTemplateRequest.php +++ b/src/Models/Operations/UpdateJWTTemplateRequest.php @@ -29,6 +29,7 @@ class UpdateJWTTemplateRequest /** * @param string $templateId * @param ?UpdateJWTTemplateRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $templateId, ?UpdateJWTTemplateRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UpdateJWTTemplateRequestBody.php b/src/Models/Operations/UpdateJWTTemplateRequestBody.php index 2dfd328..5257876 100644 --- a/src/Models/Operations/UpdateJWTTemplateRequestBody.php +++ b/src/Models/Operations/UpdateJWTTemplateRequestBody.php @@ -83,6 +83,7 @@ class UpdateJWTTemplateRequestBody * @param ?float $allowedClockSkew * @param ?string $signingAlgorithm * @param ?string $signingKey + * @phpstan-pure */ public function __construct(?string $name = null, ?UpdateJWTTemplateClaims $claims = null, ?bool $customSigningKey = null, ?float $lifetime = null, ?float $allowedClockSkew = null, ?string $signingAlgorithm = null, ?string $signingKey = null) { diff --git a/src/Models/Operations/UpdateJWTTemplateResponse.php b/src/Models/Operations/UpdateJWTTemplateResponse.php index 6978028..c39d070 100644 --- a/src/Models/Operations/UpdateJWTTemplateResponse.php +++ b/src/Models/Operations/UpdateJWTTemplateResponse.php @@ -44,6 +44,7 @@ class UpdateJWTTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\JWTTemplate $jwtTemplate + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\JWTTemplate $jwtTemplate = null) { diff --git a/src/Models/Operations/UpdateOAuthApplicationRequest.php b/src/Models/Operations/UpdateOAuthApplicationRequest.php index e3ad495..1abd115 100644 --- a/src/Models/Operations/UpdateOAuthApplicationRequest.php +++ b/src/Models/Operations/UpdateOAuthApplicationRequest.php @@ -29,6 +29,7 @@ class UpdateOAuthApplicationRequest /** * @param string $oauthApplicationId * @param UpdateOAuthApplicationRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $oauthApplicationId, UpdateOAuthApplicationRequestBody $requestBody) { diff --git a/src/Models/Operations/UpdateOAuthApplicationRequestBody.php b/src/Models/Operations/UpdateOAuthApplicationRequestBody.php index cfe9ed1..170176c 100644 --- a/src/Models/Operations/UpdateOAuthApplicationRequestBody.php +++ b/src/Models/Operations/UpdateOAuthApplicationRequestBody.php @@ -11,6 +11,15 @@ class UpdateOAuthApplicationRequestBody { + /** + * If true, this client is public and you can use the Proof Key of Code Exchange (PKCE) flow. + * + * @var ?bool $public + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('public')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $public = null; + /** * The new name of the OAuth application * @@ -20,10 +29,21 @@ class UpdateOAuthApplicationRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $name = null; + /** + * An array of redirect URIs of the new OAuth application + * + * @var ?array $redirectUris + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('redirect_uris')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $redirectUris = null; + /** * The new callback URL of the OAuth application * * @var ?string $callbackUrl + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ #[\Speakeasy\Serializer\Annotation\SerializedName('callback_url')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] @@ -39,13 +59,18 @@ class UpdateOAuthApplicationRequestBody public ?string $scopes = null; /** + * @param ?bool $public * @param ?string $name + * @param ?array $redirectUris * @param ?string $callbackUrl * @param ?string $scopes + * @phpstan-pure */ - public function __construct(?string $name = null, ?string $callbackUrl = null, ?string $scopes = 'profile email') + public function __construct(?bool $public = null, ?string $name = null, ?array $redirectUris = null, ?string $callbackUrl = null, ?string $scopes = 'profile email') { + $this->public = $public; $this->name = $name; + $this->redirectUris = $redirectUris; $this->callbackUrl = $callbackUrl; $this->scopes = $scopes; } diff --git a/src/Models/Operations/UpdateOAuthApplicationResponse.php b/src/Models/Operations/UpdateOAuthApplicationResponse.php index a3b61cb..d461188 100644 --- a/src/Models/Operations/UpdateOAuthApplicationResponse.php +++ b/src/Models/Operations/UpdateOAuthApplicationResponse.php @@ -44,6 +44,7 @@ class UpdateOAuthApplicationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OAuthApplication $oAuthApplication + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OAuthApplication $oAuthApplication = null) { diff --git a/src/Models/Operations/UpdateOrganizationDomainRequest.php b/src/Models/Operations/UpdateOrganizationDomainRequest.php index b5f71af..6a51749 100644 --- a/src/Models/Operations/UpdateOrganizationDomainRequest.php +++ b/src/Models/Operations/UpdateOrganizationDomainRequest.php @@ -38,6 +38,7 @@ class UpdateOrganizationDomainRequest * @param string $organizationId * @param string $domainId * @param UpdateOrganizationDomainRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, string $domainId, UpdateOrganizationDomainRequestBody $requestBody) { diff --git a/src/Models/Operations/UpdateOrganizationDomainRequestBody.php b/src/Models/Operations/UpdateOrganizationDomainRequestBody.php index c68fa07..c14a8e4 100644 --- a/src/Models/Operations/UpdateOrganizationDomainRequestBody.php +++ b/src/Models/Operations/UpdateOrganizationDomainRequestBody.php @@ -32,6 +32,7 @@ class UpdateOrganizationDomainRequestBody /** * @param ?string $enrollmentMode * @param ?bool $verified + * @phpstan-pure */ public function __construct(?string $enrollmentMode = null, ?bool $verified = null) { diff --git a/src/Models/Operations/UpdateOrganizationDomainResponse.php b/src/Models/Operations/UpdateOrganizationDomainResponse.php index 8b3466c..30d88c8 100644 --- a/src/Models/Operations/UpdateOrganizationDomainResponse.php +++ b/src/Models/Operations/UpdateOrganizationDomainResponse.php @@ -44,6 +44,7 @@ class UpdateOrganizationDomainResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationDomain $organizationDomain + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationDomain $organizationDomain = null) { diff --git a/src/Models/Operations/UpdateOrganizationMembershipMetadataRequest.php b/src/Models/Operations/UpdateOrganizationMembershipMetadataRequest.php index 37ed9d5..f20f6b5 100644 --- a/src/Models/Operations/UpdateOrganizationMembershipMetadataRequest.php +++ b/src/Models/Operations/UpdateOrganizationMembershipMetadataRequest.php @@ -38,6 +38,7 @@ class UpdateOrganizationMembershipMetadataRequest * @param string $organizationId * @param string $userId * @param ?UpdateOrganizationMembershipMetadataRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, string $userId, ?UpdateOrganizationMembershipMetadataRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.php b/src/Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.php index f74e4fe..1bad8f5 100644 --- a/src/Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.php +++ b/src/Models/Operations/UpdateOrganizationMembershipMetadataRequestBody.php @@ -38,6 +38,7 @@ class UpdateOrganizationMembershipMetadataRequestBody /** * @param ?array $publicMetadata * @param ?array $privateMetadata + * @phpstan-pure */ public function __construct(?array $publicMetadata = null, ?array $privateMetadata = null) { diff --git a/src/Models/Operations/UpdateOrganizationMembershipMetadataResponse.php b/src/Models/Operations/UpdateOrganizationMembershipMetadataResponse.php index 624916e..78a4688 100644 --- a/src/Models/Operations/UpdateOrganizationMembershipMetadataResponse.php +++ b/src/Models/Operations/UpdateOrganizationMembershipMetadataResponse.php @@ -44,6 +44,7 @@ class UpdateOrganizationMembershipMetadataResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationMembership $organizationMembership + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationMembership $organizationMembership = null) { diff --git a/src/Models/Operations/UpdateOrganizationMembershipRequest.php b/src/Models/Operations/UpdateOrganizationMembershipRequest.php index a788651..dec8302 100644 --- a/src/Models/Operations/UpdateOrganizationMembershipRequest.php +++ b/src/Models/Operations/UpdateOrganizationMembershipRequest.php @@ -38,6 +38,7 @@ class UpdateOrganizationMembershipRequest * @param string $organizationId * @param string $userId * @param UpdateOrganizationMembershipRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, string $userId, UpdateOrganizationMembershipRequestBody $requestBody) { diff --git a/src/Models/Operations/UpdateOrganizationMembershipRequestBody.php b/src/Models/Operations/UpdateOrganizationMembershipRequestBody.php index 390357c..ecc0d5a 100644 --- a/src/Models/Operations/UpdateOrganizationMembershipRequestBody.php +++ b/src/Models/Operations/UpdateOrganizationMembershipRequestBody.php @@ -21,6 +21,7 @@ class UpdateOrganizationMembershipRequestBody /** * @param string $role + * @phpstan-pure */ public function __construct(string $role) { diff --git a/src/Models/Operations/UpdateOrganizationMembershipResponse.php b/src/Models/Operations/UpdateOrganizationMembershipResponse.php index 63bb22b..a7234f5 100644 --- a/src/Models/Operations/UpdateOrganizationMembershipResponse.php +++ b/src/Models/Operations/UpdateOrganizationMembershipResponse.php @@ -44,6 +44,7 @@ class UpdateOrganizationMembershipResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationMembership $organizationMembership + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationMembership $organizationMembership = null) { diff --git a/src/Models/Operations/UpdateOrganizationRequest.php b/src/Models/Operations/UpdateOrganizationRequest.php index 81b365e..3291c21 100644 --- a/src/Models/Operations/UpdateOrganizationRequest.php +++ b/src/Models/Operations/UpdateOrganizationRequest.php @@ -29,6 +29,7 @@ class UpdateOrganizationRequest /** * @param string $organizationId * @param UpdateOrganizationRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, UpdateOrganizationRequestBody $requestBody) { diff --git a/src/Models/Operations/UpdateOrganizationRequestBody.php b/src/Models/Operations/UpdateOrganizationRequestBody.php index 6a03595..bef9fc9 100644 --- a/src/Models/Operations/UpdateOrganizationRequestBody.php +++ b/src/Models/Operations/UpdateOrganizationRequestBody.php @@ -86,6 +86,7 @@ class UpdateOrganizationRequestBody * @param ?string $slug * @param ?int $maxAllowedMemberships * @param ?bool $adminDeleteEnabled + * @phpstan-pure */ public function __construct(?array $publicMetadata = null, ?array $privateMetadata = null, ?string $createdAt = null, ?string $name = null, ?string $slug = null, ?int $maxAllowedMemberships = null, ?bool $adminDeleteEnabled = null) { diff --git a/src/Models/Operations/UpdateOrganizationResponse.php b/src/Models/Operations/UpdateOrganizationResponse.php index 8cc1d45..6e2414b 100644 --- a/src/Models/Operations/UpdateOrganizationResponse.php +++ b/src/Models/Operations/UpdateOrganizationResponse.php @@ -44,6 +44,7 @@ class UpdateOrganizationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/UpdatePhoneNumberRequest.php b/src/Models/Operations/UpdatePhoneNumberRequest.php index 3d939b4..3b0a10b 100644 --- a/src/Models/Operations/UpdatePhoneNumberRequest.php +++ b/src/Models/Operations/UpdatePhoneNumberRequest.php @@ -29,6 +29,7 @@ class UpdatePhoneNumberRequest /** * @param string $phoneNumberId * @param ?UpdatePhoneNumberRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $phoneNumberId, ?UpdatePhoneNumberRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UpdatePhoneNumberRequestBody.php b/src/Models/Operations/UpdatePhoneNumberRequestBody.php index 07aef76..42ade1d 100644 --- a/src/Models/Operations/UpdatePhoneNumberRequestBody.php +++ b/src/Models/Operations/UpdatePhoneNumberRequestBody.php @@ -45,6 +45,7 @@ class UpdatePhoneNumberRequestBody * @param ?bool $verified * @param ?bool $primary * @param ?bool $reservedForSecondFactor + * @phpstan-pure */ public function __construct(?bool $verified = null, ?bool $primary = null, ?bool $reservedForSecondFactor = null) { diff --git a/src/Models/Operations/UpdatePhoneNumberResponse.php b/src/Models/Operations/UpdatePhoneNumberResponse.php index f9c1885..0bb53df 100644 --- a/src/Models/Operations/UpdatePhoneNumberResponse.php +++ b/src/Models/Operations/UpdatePhoneNumberResponse.php @@ -44,6 +44,7 @@ class UpdatePhoneNumberResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\PhoneNumber $phoneNumber + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\PhoneNumber $phoneNumber = null) { diff --git a/src/Models/Operations/UpdateProductionInstanceDomainRequestBody.php b/src/Models/Operations/UpdateProductionInstanceDomainRequestBody.php index d0a59b9..eea1bcf 100644 --- a/src/Models/Operations/UpdateProductionInstanceDomainRequestBody.php +++ b/src/Models/Operations/UpdateProductionInstanceDomainRequestBody.php @@ -22,6 +22,7 @@ class UpdateProductionInstanceDomainRequestBody /** * @param ?string $homeUrl + * @phpstan-pure */ public function __construct(?string $homeUrl = null) { diff --git a/src/Models/Operations/UpdateProductionInstanceDomainResponse.php b/src/Models/Operations/UpdateProductionInstanceDomainResponse.php index 30d10ff..67d7d43 100644 --- a/src/Models/Operations/UpdateProductionInstanceDomainResponse.php +++ b/src/Models/Operations/UpdateProductionInstanceDomainResponse.php @@ -36,6 +36,7 @@ class UpdateProductionInstanceDomainResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/UpdateSAMLConnectionAttributeMapping.php b/src/Models/Operations/UpdateSAMLConnectionAttributeMapping.php index b2cda3c..e78b9a4 100644 --- a/src/Models/Operations/UpdateSAMLConnectionAttributeMapping.php +++ b/src/Models/Operations/UpdateSAMLConnectionAttributeMapping.php @@ -49,6 +49,7 @@ class UpdateSAMLConnectionAttributeMapping * @param ?string $emailAddress * @param ?string $firstName * @param ?string $lastName + * @phpstan-pure */ public function __construct(?string $userId = null, ?string $emailAddress = null, ?string $firstName = null, ?string $lastName = null) { diff --git a/src/Models/Operations/UpdateSAMLConnectionRequest.php b/src/Models/Operations/UpdateSAMLConnectionRequest.php index 783ec80..617c8b6 100644 --- a/src/Models/Operations/UpdateSAMLConnectionRequest.php +++ b/src/Models/Operations/UpdateSAMLConnectionRequest.php @@ -29,6 +29,7 @@ class UpdateSAMLConnectionRequest /** * @param string $samlConnectionId * @param UpdateSAMLConnectionRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $samlConnectionId, UpdateSAMLConnectionRequestBody $requestBody) { diff --git a/src/Models/Operations/UpdateSAMLConnectionRequestBody.php b/src/Models/Operations/UpdateSAMLConnectionRequestBody.php index 1905451..404bf05 100644 --- a/src/Models/Operations/UpdateSAMLConnectionRequestBody.php +++ b/src/Models/Operations/UpdateSAMLConnectionRequestBody.php @@ -153,6 +153,7 @@ class UpdateSAMLConnectionRequestBody * @param ?bool $allowSubdomains * @param ?bool $allowIdpInitiated * @param ?bool $disableAdditionalIdentifications + * @phpstan-pure */ public function __construct(?string $name = null, ?string $domain = null, ?string $idpEntityId = null, ?string $idpSsoUrl = null, ?string $idpCertificate = null, ?string $idpMetadataUrl = null, ?string $idpMetadata = null, ?string $organizationId = null, ?UpdateSAMLConnectionAttributeMapping $attributeMapping = null, ?bool $active = null, ?bool $syncUserAttributes = null, ?bool $allowSubdomains = null, ?bool $allowIdpInitiated = null, ?bool $disableAdditionalIdentifications = null) { diff --git a/src/Models/Operations/UpdateSAMLConnectionResponse.php b/src/Models/Operations/UpdateSAMLConnectionResponse.php index c6116bc..644656b 100644 --- a/src/Models/Operations/UpdateSAMLConnectionResponse.php +++ b/src/Models/Operations/UpdateSAMLConnectionResponse.php @@ -44,6 +44,7 @@ class UpdateSAMLConnectionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SchemasSAMLConnection $schemasSAMLConnection + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SchemasSAMLConnection $schemasSAMLConnection = null) { diff --git a/src/Models/Operations/UpdateSignUpRequest.php b/src/Models/Operations/UpdateSignUpRequest.php index 5036d43..76432b7 100644 --- a/src/Models/Operations/UpdateSignUpRequest.php +++ b/src/Models/Operations/UpdateSignUpRequest.php @@ -29,6 +29,7 @@ class UpdateSignUpRequest /** * @param string $id * @param ?UpdateSignUpRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $id, ?UpdateSignUpRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UpdateSignUpRequestBody.php b/src/Models/Operations/UpdateSignUpRequestBody.php index e3301dd..fc8f7ab 100644 --- a/src/Models/Operations/UpdateSignUpRequestBody.php +++ b/src/Models/Operations/UpdateSignUpRequestBody.php @@ -24,6 +24,7 @@ class UpdateSignUpRequestBody /** * @param ?string $externalId + * @phpstan-pure */ public function __construct(?string $externalId = null) { diff --git a/src/Models/Operations/UpdateSignUpResponse.php b/src/Models/Operations/UpdateSignUpResponse.php index 221881d..b9218b1 100644 --- a/src/Models/Operations/UpdateSignUpResponse.php +++ b/src/Models/Operations/UpdateSignUpResponse.php @@ -44,6 +44,7 @@ class UpdateSignUpResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\SignUp $signUp + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\SignUp $signUp = null) { diff --git a/src/Models/Operations/UpdateUserMetadataRequest.php b/src/Models/Operations/UpdateUserMetadataRequest.php index f137a8c..d425dc8 100644 --- a/src/Models/Operations/UpdateUserMetadataRequest.php +++ b/src/Models/Operations/UpdateUserMetadataRequest.php @@ -29,6 +29,7 @@ class UpdateUserMetadataRequest /** * @param string $userId * @param ?UpdateUserMetadataRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $userId, ?UpdateUserMetadataRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UpdateUserMetadataRequestBody.php b/src/Models/Operations/UpdateUserMetadataRequestBody.php index 83bc07e..7886a35 100644 --- a/src/Models/Operations/UpdateUserMetadataRequestBody.php +++ b/src/Models/Operations/UpdateUserMetadataRequestBody.php @@ -53,6 +53,7 @@ class UpdateUserMetadataRequestBody * @param ?array $publicMetadata * @param ?array $privateMetadata * @param ?array $unsafeMetadata + * @phpstan-pure */ public function __construct(?array $publicMetadata = null, ?array $privateMetadata = null, ?array $unsafeMetadata = null) { diff --git a/src/Models/Operations/UpdateUserMetadataResponse.php b/src/Models/Operations/UpdateUserMetadataResponse.php index f0a8862..16b9ac1 100644 --- a/src/Models/Operations/UpdateUserMetadataResponse.php +++ b/src/Models/Operations/UpdateUserMetadataResponse.php @@ -44,6 +44,7 @@ class UpdateUserMetadataResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/UpdateUserRequest.php b/src/Models/Operations/UpdateUserRequest.php index ebdd0c7..f1700d3 100644 --- a/src/Models/Operations/UpdateUserRequest.php +++ b/src/Models/Operations/UpdateUserRequest.php @@ -29,6 +29,7 @@ class UpdateUserRequest /** * @param string $userId * @param UpdateUserRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $userId, UpdateUserRequestBody $requestBody) { diff --git a/src/Models/Operations/UpdateUserRequestBody.php b/src/Models/Operations/UpdateUserRequestBody.php index 7a80c95..99ce259 100644 --- a/src/Models/Operations/UpdateUserRequestBody.php +++ b/src/Models/Operations/UpdateUserRequestBody.php @@ -302,6 +302,7 @@ class UpdateUserRequestBody * @param ?string $legalAcceptedAt * @param ?bool $skipLegalChecks * @param ?int $createOrganizationsLimit + * @phpstan-pure */ public function __construct(?string $primaryEmailAddressId = null, ?string $primaryPhoneNumberId = null, ?string $primaryWeb3WalletId = null, ?string $passwordDigest = null, ?string $passwordHasher = null, ?string $totpSecret = null, ?array $backupCodes = null, ?array $publicMetadata = null, ?array $privateMetadata = null, ?array $unsafeMetadata = null, ?string $createdAt = null, ?string $externalId = null, ?string $firstName = null, ?string $lastName = null, ?string $username = null, ?string $profileImageId = null, ?string $password = null, ?bool $skipPasswordChecks = null, ?bool $signOutOfOtherSessions = null, ?bool $deleteSelfEnabled = null, ?bool $createOrganizationEnabled = null, ?string $legalAcceptedAt = null, ?bool $skipLegalChecks = null, ?int $createOrganizationsLimit = null, ?bool $notifyPrimaryEmailAddressChanged = false) { diff --git a/src/Models/Operations/UpdateUserResponse.php b/src/Models/Operations/UpdateUserResponse.php index fc3e9db..48f8f63 100644 --- a/src/Models/Operations/UpdateUserResponse.php +++ b/src/Models/Operations/UpdateUserResponse.php @@ -44,6 +44,7 @@ class UpdateUserResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\User $user + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\User $user = null) { diff --git a/src/Models/Operations/UploadOrganizationLogoFile.php b/src/Models/Operations/UploadOrganizationLogoFile.php index 69406a0..ac0cf7f 100644 --- a/src/Models/Operations/UploadOrganizationLogoFile.php +++ b/src/Models/Operations/UploadOrganizationLogoFile.php @@ -28,6 +28,7 @@ class UploadOrganizationLogoFile /** * @param string $fileName * @param string $content + * @phpstan-pure */ public function __construct(string $fileName, string $content) { diff --git a/src/Models/Operations/UploadOrganizationLogoRequest.php b/src/Models/Operations/UploadOrganizationLogoRequest.php index d3671a5..f548ea5 100644 --- a/src/Models/Operations/UploadOrganizationLogoRequest.php +++ b/src/Models/Operations/UploadOrganizationLogoRequest.php @@ -29,6 +29,7 @@ class UploadOrganizationLogoRequest /** * @param string $organizationId * @param ?UploadOrganizationLogoRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $organizationId, ?UploadOrganizationLogoRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UploadOrganizationLogoRequestBody.php b/src/Models/Operations/UploadOrganizationLogoRequestBody.php index f252df4..f40dc9f 100644 --- a/src/Models/Operations/UploadOrganizationLogoRequestBody.php +++ b/src/Models/Operations/UploadOrganizationLogoRequestBody.php @@ -29,6 +29,7 @@ class UploadOrganizationLogoRequestBody /** * @param UploadOrganizationLogoFile $file * @param ?string $uploaderUserId + * @phpstan-pure */ public function __construct(UploadOrganizationLogoFile $file, ?string $uploaderUserId = null) { diff --git a/src/Models/Operations/UploadOrganizationLogoResponse.php b/src/Models/Operations/UploadOrganizationLogoResponse.php index 98e18ea..a390a51 100644 --- a/src/Models/Operations/UploadOrganizationLogoResponse.php +++ b/src/Models/Operations/UploadOrganizationLogoResponse.php @@ -44,6 +44,7 @@ class UploadOrganizationLogoResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationWithLogo $organizationWithLogo + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationWithLogo $organizationWithLogo = null) { diff --git a/src/Models/Operations/UpsertTemplateRequest.php b/src/Models/Operations/UpsertTemplateRequest.php index 6c2f20a..7e7394d 100644 --- a/src/Models/Operations/UpsertTemplateRequest.php +++ b/src/Models/Operations/UpsertTemplateRequest.php @@ -38,6 +38,7 @@ class UpsertTemplateRequest * @param UpsertTemplatePathParamTemplateType $templateType * @param string $slug * @param ?UpsertTemplateRequestBody $requestBody + * @phpstan-pure */ public function __construct(UpsertTemplatePathParamTemplateType $templateType, string $slug, ?UpsertTemplateRequestBody $requestBody = null) { diff --git a/src/Models/Operations/UpsertTemplateRequestBody.php b/src/Models/Operations/UpsertTemplateRequestBody.php index 34c5822..4d92aed 100644 --- a/src/Models/Operations/UpsertTemplateRequestBody.php +++ b/src/Models/Operations/UpsertTemplateRequestBody.php @@ -90,6 +90,7 @@ class UpsertTemplateRequestBody * @param ?string $subject * @param ?string $markup * @param ?bool $deliveredByClerk + * @phpstan-pure */ public function __construct(?string $name = null, ?string $body = null, ?string $fromEmailName = null, ?string $replyToEmailName = null, ?string $subject = null, ?string $markup = null, ?bool $deliveredByClerk = null) { diff --git a/src/Models/Operations/UpsertTemplateResponse.php b/src/Models/Operations/UpsertTemplateResponse.php index c419c11..33fa4fa 100644 --- a/src/Models/Operations/UpsertTemplateResponse.php +++ b/src/Models/Operations/UpsertTemplateResponse.php @@ -44,6 +44,7 @@ class UpsertTemplateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Template $template + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Template $template = null) { diff --git a/src/Models/Operations/UserPasskeyDeleteRequest.php b/src/Models/Operations/UserPasskeyDeleteRequest.php index 3f54697..6ce58f6 100644 --- a/src/Models/Operations/UserPasskeyDeleteRequest.php +++ b/src/Models/Operations/UserPasskeyDeleteRequest.php @@ -30,6 +30,7 @@ class UserPasskeyDeleteRequest /** * @param string $userId * @param string $passkeyIdentificationId + * @phpstan-pure */ public function __construct(string $userId, string $passkeyIdentificationId) { diff --git a/src/Models/Operations/UserPasskeyDeleteResponse.php b/src/Models/Operations/UserPasskeyDeleteResponse.php index fab596a..7f9e728 100644 --- a/src/Models/Operations/UserPasskeyDeleteResponse.php +++ b/src/Models/Operations/UserPasskeyDeleteResponse.php @@ -44,6 +44,7 @@ class UserPasskeyDeleteResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/UserWeb3WalletDeleteRequest.php b/src/Models/Operations/UserWeb3WalletDeleteRequest.php index 493b7d7..ba8b790 100644 --- a/src/Models/Operations/UserWeb3WalletDeleteRequest.php +++ b/src/Models/Operations/UserWeb3WalletDeleteRequest.php @@ -30,6 +30,7 @@ class UserWeb3WalletDeleteRequest /** * @param string $userId * @param string $web3WalletIdentificationId + * @phpstan-pure */ public function __construct(string $userId, string $web3WalletIdentificationId) { diff --git a/src/Models/Operations/UserWeb3WalletDeleteResponse.php b/src/Models/Operations/UserWeb3WalletDeleteResponse.php index 9b0da77..fed89b2 100644 --- a/src/Models/Operations/UserWeb3WalletDeleteResponse.php +++ b/src/Models/Operations/UserWeb3WalletDeleteResponse.php @@ -44,6 +44,7 @@ class UserWeb3WalletDeleteResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\DeletedObject $deletedObject + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\DeletedObject $deletedObject = null) { diff --git a/src/Models/Operations/UsersGetOrganizationInvitationsRequest.php b/src/Models/Operations/UsersGetOrganizationInvitationsRequest.php index 192e2f2..af5f055 100644 --- a/src/Models/Operations/UsersGetOrganizationInvitationsRequest.php +++ b/src/Models/Operations/UsersGetOrganizationInvitationsRequest.php @@ -53,6 +53,7 @@ class UsersGetOrganizationInvitationsRequest * @param ?int $limit * @param ?int $offset * @param ?QueryParamStatus $status + * @phpstan-pure */ public function __construct(string $userId, ?QueryParamStatus $status = null, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/UsersGetOrganizationInvitationsResponse.php b/src/Models/Operations/UsersGetOrganizationInvitationsResponse.php index 28cc483..bb702cc 100644 --- a/src/Models/Operations/UsersGetOrganizationInvitationsResponse.php +++ b/src/Models/Operations/UsersGetOrganizationInvitationsResponse.php @@ -44,6 +44,7 @@ class UsersGetOrganizationInvitationsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationInvitationsWithPublicOrganizationData $organizationInvitationsWithPublicOrganizationData + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationInvitationsWithPublicOrganizationData $organizationInvitationsWithPublicOrganizationData = null) { diff --git a/src/Models/Operations/UsersGetOrganizationMembershipsRequest.php b/src/Models/Operations/UsersGetOrganizationMembershipsRequest.php index 31e7371..e7019db 100644 --- a/src/Models/Operations/UsersGetOrganizationMembershipsRequest.php +++ b/src/Models/Operations/UsersGetOrganizationMembershipsRequest.php @@ -44,6 +44,7 @@ class UsersGetOrganizationMembershipsRequest * @param string $userId * @param ?int $limit * @param ?int $offset + * @phpstan-pure */ public function __construct(string $userId, ?int $limit = 10, ?int $offset = 0) { diff --git a/src/Models/Operations/UsersGetOrganizationMembershipsResponse.php b/src/Models/Operations/UsersGetOrganizationMembershipsResponse.php index 90150e0..0911dca 100644 --- a/src/Models/Operations/UsersGetOrganizationMembershipsResponse.php +++ b/src/Models/Operations/UsersGetOrganizationMembershipsResponse.php @@ -44,6 +44,7 @@ class UsersGetOrganizationMembershipsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrganizationMemberships $organizationMemberships + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrganizationMemberships $organizationMemberships = null) { diff --git a/src/Models/Operations/VerifyClientRequestBody.php b/src/Models/Operations/VerifyClientRequestBody.php index 2c8f2f1..84cf43e 100644 --- a/src/Models/Operations/VerifyClientRequestBody.php +++ b/src/Models/Operations/VerifyClientRequestBody.php @@ -23,6 +23,7 @@ class VerifyClientRequestBody /** * @param ?string $token + * @phpstan-pure */ public function __construct(?string $token = null) { diff --git a/src/Models/Operations/VerifyClientResponse.php b/src/Models/Operations/VerifyClientResponse.php index b16d452..fab8ca5 100644 --- a/src/Models/Operations/VerifyClientResponse.php +++ b/src/Models/Operations/VerifyClientResponse.php @@ -44,6 +44,7 @@ class VerifyClientResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Client $client + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Client $client = null) { diff --git a/src/Models/Operations/VerifyDomainProxyRequestBody.php b/src/Models/Operations/VerifyDomainProxyRequestBody.php index acaf4a4..629f7df 100644 --- a/src/Models/Operations/VerifyDomainProxyRequestBody.php +++ b/src/Models/Operations/VerifyDomainProxyRequestBody.php @@ -32,6 +32,7 @@ class VerifyDomainProxyRequestBody /** * @param ?string $domainId * @param ?string $proxyUrl + * @phpstan-pure */ public function __construct(?string $domainId = null, ?string $proxyUrl = null) { diff --git a/src/Models/Operations/VerifyDomainProxyResponse.php b/src/Models/Operations/VerifyDomainProxyResponse.php index 061750a..606579c 100644 --- a/src/Models/Operations/VerifyDomainProxyResponse.php +++ b/src/Models/Operations/VerifyDomainProxyResponse.php @@ -44,6 +44,7 @@ class VerifyDomainProxyResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ProxyCheck $proxyCheck + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ProxyCheck $proxyCheck = null) { diff --git a/src/Models/Operations/VerifyPasswordRequest.php b/src/Models/Operations/VerifyPasswordRequest.php index 5c20a52..6065246 100644 --- a/src/Models/Operations/VerifyPasswordRequest.php +++ b/src/Models/Operations/VerifyPasswordRequest.php @@ -29,6 +29,7 @@ class VerifyPasswordRequest /** * @param string $userId * @param ?VerifyPasswordRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $userId, ?VerifyPasswordRequestBody $requestBody = null) { diff --git a/src/Models/Operations/VerifyPasswordRequestBody.php b/src/Models/Operations/VerifyPasswordRequestBody.php index c9044ae..b99c3ad 100644 --- a/src/Models/Operations/VerifyPasswordRequestBody.php +++ b/src/Models/Operations/VerifyPasswordRequestBody.php @@ -21,6 +21,7 @@ class VerifyPasswordRequestBody /** * @param string $password + * @phpstan-pure */ public function __construct(string $password) { diff --git a/src/Models/Operations/VerifyPasswordResponse.php b/src/Models/Operations/VerifyPasswordResponse.php index 9efd1a5..7cf78fe 100644 --- a/src/Models/Operations/VerifyPasswordResponse.php +++ b/src/Models/Operations/VerifyPasswordResponse.php @@ -44,6 +44,7 @@ class VerifyPasswordResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?VerifyPasswordResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?VerifyPasswordResponseBody $object = null) { diff --git a/src/Models/Operations/VerifyPasswordResponseBody.php b/src/Models/Operations/VerifyPasswordResponseBody.php index a97a92c..1721309 100644 --- a/src/Models/Operations/VerifyPasswordResponseBody.php +++ b/src/Models/Operations/VerifyPasswordResponseBody.php @@ -22,6 +22,7 @@ class VerifyPasswordResponseBody /** * @param ?bool $verified + * @phpstan-pure */ public function __construct(?bool $verified = null) { diff --git a/src/Models/Operations/VerifySessionRequest.php b/src/Models/Operations/VerifySessionRequest.php index 08be658..4073689 100644 --- a/src/Models/Operations/VerifySessionRequest.php +++ b/src/Models/Operations/VerifySessionRequest.php @@ -30,6 +30,7 @@ class VerifySessionRequest /** * @param string $sessionId * @param ?VerifySessionRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $sessionId, ?VerifySessionRequestBody $requestBody = null) { diff --git a/src/Models/Operations/VerifySessionRequestBody.php b/src/Models/Operations/VerifySessionRequestBody.php index 9799c75..d1254e3 100644 --- a/src/Models/Operations/VerifySessionRequestBody.php +++ b/src/Models/Operations/VerifySessionRequestBody.php @@ -25,6 +25,7 @@ class VerifySessionRequestBody /** * @param ?string $token + * @phpstan-pure */ public function __construct(?string $token = null) { diff --git a/src/Models/Operations/VerifySessionResponse.php b/src/Models/Operations/VerifySessionResponse.php index edb000e..4987f86 100644 --- a/src/Models/Operations/VerifySessionResponse.php +++ b/src/Models/Operations/VerifySessionResponse.php @@ -44,6 +44,7 @@ class VerifySessionResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Session $session + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Session $session = null) { diff --git a/src/Models/Operations/VerifyTOTPRequest.php b/src/Models/Operations/VerifyTOTPRequest.php index 7599cff..09eb20f 100644 --- a/src/Models/Operations/VerifyTOTPRequest.php +++ b/src/Models/Operations/VerifyTOTPRequest.php @@ -29,6 +29,7 @@ class VerifyTOTPRequest /** * @param string $userId * @param ?VerifyTOTPRequestBody $requestBody + * @phpstan-pure */ public function __construct(string $userId, ?VerifyTOTPRequestBody $requestBody = null) { diff --git a/src/Models/Operations/VerifyTOTPRequestBody.php b/src/Models/Operations/VerifyTOTPRequestBody.php index 4abbefe..4cb31c9 100644 --- a/src/Models/Operations/VerifyTOTPRequestBody.php +++ b/src/Models/Operations/VerifyTOTPRequestBody.php @@ -21,6 +21,7 @@ class VerifyTOTPRequestBody /** * @param string $code + * @phpstan-pure */ public function __construct(string $code) { diff --git a/src/Models/Operations/VerifyTOTPResponse.php b/src/Models/Operations/VerifyTOTPResponse.php index 193da95..a2ab0a4 100644 --- a/src/Models/Operations/VerifyTOTPResponse.php +++ b/src/Models/Operations/VerifyTOTPResponse.php @@ -44,6 +44,7 @@ class VerifyTOTPResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?VerifyTOTPResponseBody $object + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?VerifyTOTPResponseBody $object = null) { diff --git a/src/Models/Operations/VerifyTOTPResponseBody.php b/src/Models/Operations/VerifyTOTPResponseBody.php index 0341a5a..da61b80 100644 --- a/src/Models/Operations/VerifyTOTPResponseBody.php +++ b/src/Models/Operations/VerifyTOTPResponseBody.php @@ -32,6 +32,7 @@ class VerifyTOTPResponseBody /** * @param ?bool $verified * @param ?CodeType $codeType + * @phpstan-pure */ public function __construct(?bool $verified = null, ?CodeType $codeType = null) { diff --git a/src/OauthApplications.php b/src/OauthApplications.php index 3b2f0bf..ca2fe1a 100644 --- a/src/OauthApplications.php +++ b/src/OauthApplications.php @@ -81,11 +81,11 @@ public function create(?Operations\CreateOAuthApplicationRequestBody $request = $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -102,7 +102,7 @@ public function create(?Operations\CreateOAuthApplicationRequestBody $request = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -113,9 +113,9 @@ public function create(?Operations\CreateOAuthApplicationRequestBody $request = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -157,11 +157,11 @@ public function delete(string $oauthApplicationId, ?Options $options = null): Op $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -178,7 +178,7 @@ public function delete(string $oauthApplicationId, ?Options $options = null): Op } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -189,9 +189,9 @@ public function delete(string $oauthApplicationId, ?Options $options = null): Op } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -232,11 +232,11 @@ public function get(string $oauthApplicationId, ?Options $options = null): Opera $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -253,7 +253,7 @@ public function get(string $oauthApplicationId, ?Options $options = null): Opera } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -264,9 +264,9 @@ public function get(string $oauthApplicationId, ?Options $options = null): Opera } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -315,11 +315,11 @@ public function list(?int $limit = null, ?int $offset = null, ?Options $options $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -336,7 +336,7 @@ public function list(?int $limit = null, ?int $offset = null, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -347,9 +347,9 @@ public function list(?int $limit = null, ?int $offset = null, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -391,11 +391,11 @@ public function rotateSecret(string $oauthApplicationId, ?Options $options = nul $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -412,7 +412,7 @@ public function rotateSecret(string $oauthApplicationId, ?Options $options = nul } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -423,9 +423,9 @@ public function rotateSecret(string $oauthApplicationId, ?Options $options = nul } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -473,11 +473,11 @@ public function update(Operations\UpdateOAuthApplicationRequestBody $requestBody $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -494,7 +494,7 @@ public function update(Operations\UpdateOAuthApplicationRequestBody $requestBody } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -505,9 +505,9 @@ public function update(Operations\UpdateOAuthApplicationRequestBody $requestBody } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/OrganizationDomain.php b/src/OrganizationDomain.php index 6f06d04..0c3057c 100644 --- a/src/OrganizationDomain.php +++ b/src/OrganizationDomain.php @@ -87,11 +87,11 @@ public function update(Operations\UpdateOrganizationDomainRequestBody $requestBo $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -108,7 +108,7 @@ public function update(Operations\UpdateOrganizationDomainRequestBody $requestBo } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -119,9 +119,9 @@ public function update(Operations\UpdateOrganizationDomainRequestBody $requestBo } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/OrganizationDomains.php b/src/OrganizationDomains.php index c61b8d4..19facdb 100644 --- a/src/OrganizationDomains.php +++ b/src/OrganizationDomains.php @@ -85,11 +85,11 @@ public function create(Operations\CreateOrganizationDomainRequestBody $requestBo $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -106,7 +106,7 @@ public function create(Operations\CreateOrganizationDomainRequestBody $requestBo } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -117,9 +117,9 @@ public function create(Operations\CreateOrganizationDomainRequestBody $requestBo } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -162,11 +162,11 @@ public function delete(string $organizationId, string $domainId, ?Options $optio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -183,7 +183,7 @@ public function delete(string $organizationId, string $domainId, ?Options $optio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -194,9 +194,9 @@ public function delete(string $organizationId, string $domainId, ?Options $optio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -237,11 +237,11 @@ public function list(Operations\ListOrganizationDomainsRequest $request, ?Option $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -258,7 +258,7 @@ public function list(Operations\ListOrganizationDomainsRequest $request, ?Option } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [401, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -269,9 +269,9 @@ public function list(Operations\ListOrganizationDomainsRequest $request, ?Option } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/OrganizationInvitations.php b/src/OrganizationInvitations.php index 4eea5ec..a857a39 100644 --- a/src/OrganizationInvitations.php +++ b/src/OrganizationInvitations.php @@ -99,11 +99,11 @@ public function create(string $organizationId, ?Operations\CreateOrganizationInv $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -120,7 +120,7 @@ public function create(string $organizationId, ?Operations\CreateOrganizationInv } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -131,9 +131,9 @@ public function create(string $organizationId, ?Operations\CreateOrganizationInv } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -193,11 +193,11 @@ public function bulkCreate(array $requestBody, string $organizationId, ?Options $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -214,7 +214,7 @@ public function bulkCreate(array $requestBody, string $organizationId, ?Options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -225,9 +225,9 @@ public function bulkCreate(array $requestBody, string $organizationId, ?Options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -270,11 +270,11 @@ public function get(string $organizationId, string $invitationId, ?Options $opti $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -291,7 +291,7 @@ public function get(string $organizationId, string $invitationId, ?Options $opti } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -302,9 +302,9 @@ public function get(string $organizationId, string $invitationId, ?Options $opti } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -350,11 +350,11 @@ public function getAll(?Operations\ListInstanceOrganizationInvitationsRequest $r $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -371,7 +371,7 @@ public function getAll(?Operations\ListInstanceOrganizationInvitationsRequest $r } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -382,7 +382,7 @@ public function getAll(?Operations\ListInstanceOrganizationInvitationsRequest $r } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -393,9 +393,9 @@ public function getAll(?Operations\ListInstanceOrganizationInvitationsRequest $r } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -450,11 +450,11 @@ public function list(string $organizationId, ?int $limit = null, ?int $offset = $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -471,7 +471,7 @@ public function list(string $organizationId, ?int $limit = null, ?int $offset = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -482,9 +482,9 @@ public function list(string $organizationId, ?int $limit = null, ?int $offset = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -539,11 +539,11 @@ public function listPending(string $organizationId, ?int $limit = null, ?int $of $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -560,7 +560,7 @@ public function listPending(string $organizationId, ?int $limit = null, ?int $of } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -571,9 +571,9 @@ public function listPending(string $organizationId, ?int $limit = null, ?int $of } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -626,11 +626,11 @@ public function revoke(string $organizationId, string $invitationId, ?Operations $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -647,7 +647,7 @@ public function revoke(string $organizationId, string $invitationId, ?Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -658,9 +658,9 @@ public function revoke(string $organizationId, string $invitationId, ?Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/OrganizationMemberships.php b/src/OrganizationMemberships.php index ab6383a..444b560 100644 --- a/src/OrganizationMemberships.php +++ b/src/OrganizationMemberships.php @@ -90,11 +90,11 @@ public function create(Operations\CreateOrganizationMembershipRequestBody $reque $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -111,7 +111,7 @@ public function create(Operations\CreateOrganizationMembershipRequestBody $reque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -122,9 +122,9 @@ public function create(Operations\CreateOrganizationMembershipRequestBody $reque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -167,11 +167,11 @@ public function delete(string $organizationId, string $userId, ?Options $options $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -188,7 +188,7 @@ public function delete(string $organizationId, string $userId, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -199,9 +199,9 @@ public function delete(string $organizationId, string $userId, ?Options $options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -249,11 +249,11 @@ public function getAll(?int $limit = null, ?int $offset = null, ?string $orderBy $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -270,7 +270,7 @@ public function getAll(?int $limit = null, ?int $offset = null, ?string $orderBy } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -281,7 +281,7 @@ public function getAll(?int $limit = null, ?int $offset = null, ?string $orderBy } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -292,9 +292,9 @@ public function getAll(?int $limit = null, ?int $offset = null, ?string $orderBy } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -344,11 +344,11 @@ public function list(string $organizationId, ?int $limit = null, ?int $offset = $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -365,7 +365,7 @@ public function list(string $organizationId, ?int $limit = null, ?int $offset = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [401, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -376,9 +376,9 @@ public function list(string $organizationId, ?int $limit = null, ?int $offset = } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -428,11 +428,11 @@ public function update(Operations\UpdateOrganizationMembershipRequestBody $reque $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -449,7 +449,7 @@ public function update(Operations\UpdateOrganizationMembershipRequestBody $reque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -460,9 +460,9 @@ public function update(Operations\UpdateOrganizationMembershipRequestBody $reque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -513,11 +513,11 @@ public function updateMetadata(string $organizationId, string $userId, ?Operatio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -534,7 +534,7 @@ public function updateMetadata(string $organizationId, string $userId, ?Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -545,9 +545,9 @@ public function updateMetadata(string $organizationId, string $userId, ?Operatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Organizations.php b/src/Organizations.php index e1b004c..b818e65 100644 --- a/src/Organizations.php +++ b/src/Organizations.php @@ -88,11 +88,11 @@ public function create(?Operations\CreateOrganizationRequestBody $request = null $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -109,7 +109,7 @@ public function create(?Operations\CreateOrganizationRequestBody $request = null } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -120,9 +120,9 @@ public function create(?Operations\CreateOrganizationRequestBody $request = null } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -165,11 +165,11 @@ public function delete(string $organizationId, ?Options $options = null): Operat $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -186,7 +186,7 @@ public function delete(string $organizationId, ?Options $options = null): Operat } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -197,9 +197,9 @@ public function delete(string $organizationId, ?Options $options = null): Operat } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -238,11 +238,11 @@ public function deleteLogo(string $organizationId, ?Options $options = null): Op $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -259,7 +259,7 @@ public function deleteLogo(string $organizationId, ?Options $options = null): Op } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -270,9 +270,9 @@ public function deleteLogo(string $organizationId, ?Options $options = null): Op } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -318,11 +318,11 @@ public function get(string $organizationId, ?bool $includeMembersCount = null, ? $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -339,7 +339,7 @@ public function get(string $organizationId, ?bool $includeMembersCount = null, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -350,9 +350,9 @@ public function get(string $organizationId, ?bool $includeMembersCount = null, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -396,11 +396,11 @@ public function list(?Operations\ListOrganizationsRequest $request = null, ?Opti $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -417,7 +417,7 @@ public function list(?Operations\ListOrganizationsRequest $request = null, ?Opti } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -428,9 +428,9 @@ public function list(?Operations\ListOrganizationsRequest $request = null, ?Opti } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -481,11 +481,11 @@ public function mergeMetadata(Operations\MergeOrganizationMetadataRequestBody $r $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -502,7 +502,7 @@ public function mergeMetadata(Operations\MergeOrganizationMetadataRequestBody $r } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -513,9 +513,9 @@ public function mergeMetadata(Operations\MergeOrganizationMetadataRequestBody $r } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -563,11 +563,11 @@ public function update(Operations\UpdateOrganizationRequestBody $requestBody, st $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -584,7 +584,7 @@ public function update(Operations\UpdateOrganizationRequestBody $requestBody, st } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -595,9 +595,9 @@ public function update(Operations\UpdateOrganizationRequestBody $requestBody, st } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -647,11 +647,11 @@ public function uploadLogo(string $organizationId, ?Operations\UploadOrganizatio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode == 413 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '413', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -668,7 +668,7 @@ public function uploadLogo(string $organizationId, ?Operations\UploadOrganizatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404, 413])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '413'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -679,9 +679,9 @@ public function uploadLogo(string $organizationId, ?Operations\UploadOrganizatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/PhoneNumbers.php b/src/PhoneNumbers.php index eb65c9d..7862bdb 100644 --- a/src/PhoneNumbers.php +++ b/src/PhoneNumbers.php @@ -79,11 +79,11 @@ public function create(?Operations\CreatePhoneNumberRequestBody $request = null, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +100,7 @@ public function create(?Operations\CreatePhoneNumberRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -111,9 +111,9 @@ public function create(?Operations\CreatePhoneNumberRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -154,11 +154,11 @@ public function delete(string $phoneNumberId, ?Options $options = null): Operati $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -175,7 +175,7 @@ public function delete(string $phoneNumberId, ?Options $options = null): Operati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -186,9 +186,9 @@ public function delete(string $phoneNumberId, ?Options $options = null): Operati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -229,11 +229,11 @@ public function get(string $phoneNumberId, ?Options $options = null): Operations $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -250,7 +250,7 @@ public function get(string $phoneNumberId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -261,9 +261,9 @@ public function get(string $phoneNumberId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -310,11 +310,11 @@ public function update(string $phoneNumberId, ?Operations\UpdatePhoneNumberReque $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -331,7 +331,7 @@ public function update(string $phoneNumberId, ?Operations\UpdatePhoneNumberReque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -342,9 +342,9 @@ public function update(string $phoneNumberId, ?Operations\UpdatePhoneNumberReque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/ProxyChecks.php b/src/ProxyChecks.php index 8260507..c5eea05 100644 --- a/src/ProxyChecks.php +++ b/src/ProxyChecks.php @@ -86,11 +86,11 @@ public function verify(?Operations\VerifyDomainProxyRequestBody $request = null, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -107,7 +107,7 @@ public function verify(?Operations\VerifyDomainProxyRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -118,9 +118,9 @@ public function verify(?Operations\VerifyDomainProxyRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/RedirectURLs.php b/src/RedirectURLs.php index 9ea295c..2f0bb2f 100644 --- a/src/RedirectURLs.php +++ b/src/RedirectURLs.php @@ -74,11 +74,11 @@ public function list(?Options $options = null): Operations\ListRedirectURLsRespo $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -95,9 +95,9 @@ public function list(?Options $options = null): Operations\ListRedirectURLsRespo } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index a8746a5..3a79971 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -14,9 +14,7 @@ class SDKConfiguration public ?\GuzzleHttp\ClientInterface $client = null; public Hooks\SDKHooks $hooks; - public ?Models\Components\Security $security = null; - - /** @var pure-Closure(): string */ + /** @var ?pure-Closure(): Models\Components\Security */ public ?\Closure $securitySource = null; public string $serverUrl = ''; @@ -26,11 +24,11 @@ class SDKConfiguration public string $openapiDocVersion = 'v1'; - public string $sdkVersion = '0.1.4'; + public string $sdkVersion = '0.1.5'; - public string $genVersion = '2.493.34'; + public string $genVersion = '2.506.0'; - public string $userAgent = 'speakeasy-sdk/php 0.1.4 2.493.34 v1 clerkinc/backend-php'; + public string $userAgent = 'speakeasy-sdk/php 0.1.5 2.506.0 v1 clerkinc/backend-php'; public ?RetryConfig $retryConfig = null; @@ -54,20 +52,12 @@ public function getServerUrl(): string } public function hasSecurity(): bool { - return $this->security !== null || $this->securitySource !== null; + return $this->securitySource !== null; } public function getSecurity(): ?Models\Components\Security { - if ($this->securitySource !== null) { - $security = new Models\Components\Security( - bearerAuth: $this->securitySource->call($this) - ); - - return $security; - } else { - return $this->security; - } + return $this->securitySource->call($this); } /** diff --git a/src/SamlConnections.php b/src/SamlConnections.php index b9150ed..6e6e610 100644 --- a/src/SamlConnections.php +++ b/src/SamlConnections.php @@ -79,11 +79,11 @@ public function create(?Operations\CreateSAMLConnectionRequestBody $request = nu $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +100,7 @@ public function create(?Operations\CreateSAMLConnectionRequestBody $request = nu } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -111,9 +111,9 @@ public function create(?Operations\CreateSAMLConnectionRequestBody $request = nu } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -154,11 +154,11 @@ public function delete(string $samlConnectionId, ?Options $options = null): Oper $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -175,7 +175,7 @@ public function delete(string $samlConnectionId, ?Options $options = null): Oper } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -186,9 +186,9 @@ public function delete(string $samlConnectionId, ?Options $options = null): Oper } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -229,11 +229,11 @@ public function get(string $samlConnectionId, ?Options $options = null): Operati $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -250,7 +250,7 @@ public function get(string $samlConnectionId, ?Options $options = null): Operati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -261,9 +261,9 @@ public function get(string $samlConnectionId, ?Options $options = null): Operati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -313,11 +313,11 @@ public function list(?int $limit = null, ?int $offset = null, ?array $organizati $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 403 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -334,7 +334,7 @@ public function list(?int $limit = null, ?int $offset = null, ?array $organizati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 403, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -345,9 +345,9 @@ public function list(?int $limit = null, ?int $offset = null, ?array $organizati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -395,11 +395,11 @@ public function update(Operations\UpdateSAMLConnectionRequestBody $requestBody, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -416,7 +416,7 @@ public function update(Operations\UpdateSAMLConnectionRequestBody $requestBody, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [402, 403, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402', '403', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -427,9 +427,9 @@ public function update(Operations\UpdateSAMLConnectionRequestBody $requestBody, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Sessions.php b/src/Sessions.php index 2dd1992..63d4ea9 100644 --- a/src/Sessions.php +++ b/src/Sessions.php @@ -84,11 +84,11 @@ public function createSessionToken(string $sessionId, ?Operations\CreateSessionT $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +105,7 @@ public function createSessionToken(string $sessionId, ?Operations\CreateSessionT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,9 +116,9 @@ public function createSessionToken(string $sessionId, ?Operations\CreateSessionT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -167,11 +167,11 @@ public function createTokenFromTemplate(string $sessionId, string $templateName, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -188,7 +188,7 @@ public function createTokenFromTemplate(string $sessionId, string $templateName, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -199,9 +199,9 @@ public function createTokenFromTemplate(string $sessionId, string $templateName, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -242,11 +242,11 @@ public function get(string $sessionId, ?Options $options = null): Operations\Get $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -263,7 +263,7 @@ public function get(string $sessionId, ?Options $options = null): Operations\Get } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -274,9 +274,9 @@ public function get(string $sessionId, ?Options $options = null): Operations\Get } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -320,11 +320,11 @@ public function list(?Operations\GetSessionListRequest $request = null, ?Options $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -341,7 +341,7 @@ public function list(?Operations\GetSessionListRequest $request = null, ?Options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -352,9 +352,9 @@ public function list(?Operations\GetSessionListRequest $request = null, ?Options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -396,11 +396,11 @@ public function revoke(string $sessionId, ?Options $options = null): Operations\ $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -417,7 +417,7 @@ public function revoke(string $sessionId, ?Options $options = null): Operations\ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -428,9 +428,9 @@ public function revoke(string $sessionId, ?Options $options = null): Operations\ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -482,11 +482,11 @@ public function verify(string $sessionId, ?Operations\VerifySessionRequestBody $ $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode == 410 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '410', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -503,7 +503,7 @@ public function verify(string $sessionId, ?Operations\VerifySessionRequestBody $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404, 410])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '410'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -514,9 +514,9 @@ public function verify(string $sessionId, ?Operations\VerifySessionRequestBody $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -560,11 +560,11 @@ public function createSession(?Operations\CreateSessionRequestBody $request = nu $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -581,7 +581,7 @@ public function createSession(?Operations\CreateSessionRequestBody $request = nu } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -592,9 +592,9 @@ public function createSession(?Operations\CreateSessionRequestBody $request = nu } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/SignInTokens.php b/src/SignInTokens.php index 2aa3153..e606e50 100644 --- a/src/SignInTokens.php +++ b/src/SignInTokens.php @@ -81,11 +81,11 @@ public function create(?Operations\CreateSignInTokenRequestBody $request = null, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -102,7 +102,7 @@ public function create(?Operations\CreateSignInTokenRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -113,9 +113,9 @@ public function create(?Operations\CreateSignInTokenRequestBody $request = null, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -156,11 +156,11 @@ public function revoke(string $signInTokenId, ?Options $options = null): Operati $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -177,7 +177,7 @@ public function revoke(string $signInTokenId, ?Options $options = null): Operati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -188,9 +188,9 @@ public function revoke(string $signInTokenId, ?Options $options = null): Operati } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/SignUps.php b/src/SignUps.php index a2f11ed..939c308 100644 --- a/src/SignUps.php +++ b/src/SignUps.php @@ -84,11 +84,11 @@ public function update(string $id, ?Operations\UpdateSignUpRequestBody $requestB $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +105,7 @@ public function update(string $id, ?Operations\UpdateSignUpRequestBody $requestB } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,9 +116,9 @@ public function update(string $id, ?Operations\UpdateSignUpRequestBody $requestB } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Templates.php b/src/Templates.php index 4e253e9..273617b 100644 --- a/src/Templates.php +++ b/src/Templates.php @@ -88,11 +88,11 @@ public function preview(string $templateType, string $slug, ?Operations\PreviewT $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -109,7 +109,7 @@ public function preview(string $templateType, string $slug, ?Operations\PreviewT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -120,9 +120,9 @@ public function preview(string $templateType, string $slug, ?Operations\PreviewT } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/TestingTokens.php b/src/TestingTokens.php index e1ff072..d6d8600 100644 --- a/src/TestingTokens.php +++ b/src/TestingTokens.php @@ -74,11 +74,11 @@ public function create(?Options $options = null): Operations\CreateTestingTokenR $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -95,9 +95,9 @@ public function create(?Options $options = null): Operations\CreateTestingTokenR } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Users.php b/src/Users.php index 5763dfa..d364ca8 100644 --- a/src/Users.php +++ b/src/Users.php @@ -78,11 +78,11 @@ public function ban(string $userId, ?Options $options = null): Operations\BanUse $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -99,7 +99,7 @@ public function ban(string $userId, ?Options $options = null): Operations\BanUse } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 402) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -110,9 +110,9 @@ public function ban(string $userId, ?Options $options = null): Operations\BanUse } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -160,11 +160,11 @@ public function create(?Operations\CreateUserRequestBody $request = null, ?Optio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 403 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -181,7 +181,7 @@ public function create(?Operations\CreateUserRequestBody $request = null, ?Optio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 403, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -192,96 +192,9 @@ public function create(?Operations\CreateUserRequestBody $request = null, ?Optio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { - throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } else { - throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } - } - - /** - * Create a TOTP for a user - * - * Creates a TOTP (Time-based One-Time Password) for a given user, returning both the TOTP secret and the URI. - * - * - * @param string $userId - * @return Operations\CreateUserTOTPResponse - * @throws \Clerk\Backend\Models\Errors\SDKException - */ - public function createTOTP(string $userId, ?Options $options = null): Operations\CreateUserTOTPResponse - { - $request = new Operations\CreateUserTOTPRequest( - userId: $userId, - ); - $baseUrl = $this->sdkConfiguration->getServerUrl(); - $url = Utils\Utils::generateUrl($baseUrl, '/users/{user_id}/totp', Operations\CreateUserTOTPRequest::class, $request); - $urlOverride = null; - $httpOptions = ['http_errors' => false]; - $httpOptions['headers']['Accept'] = 'application/json'; - $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; - $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); - $hookContext = new HookContext('CreateUserTOTP', null, $this->sdkConfiguration->securitySource); - $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); - $httpRequest = Utils\Utils::removeHeaders($httpRequest); - try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); - } catch (\GuzzleHttp\Exception\GuzzleException $error) { - $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - $httpResponse = $res; - } - $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; - - $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { - $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, 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, 'array', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - $response = new Operations\CreateUserTOTPResponse( - statusCode: $statusCode, - contentType: $contentType, - rawResponse: $httpResponse, - totp: $obj); - - return $response; - } else { - throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } - } elseif (in_array($statusCode, [403, 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, '\Clerk\Backend\Models\Errors\ClerkErrors', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - throw $obj->toException(); - } else { - throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } - } 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, '\Clerk\Backend\Models\Errors\ClerkErrors', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); - throw $obj->toException(); - } else { - throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } - } elseif ($statusCode >= 400 && $statusCode < 500) { - throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -322,11 +235,11 @@ public function deleteBackupCodes(string $userId, ?Options $options = null): Ope $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -343,7 +256,7 @@ public function deleteBackupCodes(string $userId, ?Options $options = null): Ope } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -354,7 +267,7 @@ public function deleteBackupCodes(string $userId, ?Options $options = null): Ope } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -365,9 +278,9 @@ public function deleteBackupCodes(string $userId, ?Options $options = null): Ope } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -410,11 +323,11 @@ public function deleteExternalAccount(string $userId, string $externalAccountId, $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -431,7 +344,7 @@ public function deleteExternalAccount(string $userId, string $externalAccountId, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -442,7 +355,7 @@ public function deleteExternalAccount(string $userId, string $externalAccountId, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -453,9 +366,9 @@ public function deleteExternalAccount(string $userId, string $externalAccountId, } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -496,11 +409,11 @@ public function deleteTotp(string $userId, ?Options $options = null): Operations $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -517,7 +430,7 @@ public function deleteTotp(string $userId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -528,7 +441,7 @@ public function deleteTotp(string $userId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -539,9 +452,9 @@ public function deleteTotp(string $userId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -582,11 +495,11 @@ public function delete(string $userId, ?Options $options = null): Operations\Del $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -603,7 +516,7 @@ public function delete(string $userId, ?Options $options = null): Operations\Del } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -614,9 +527,9 @@ public function delete(string $userId, ?Options $options = null): Operations\Del } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -657,11 +570,11 @@ public function deleteProfileImage(string $userId, ?Options $options = null): Op $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -678,7 +591,7 @@ public function deleteProfileImage(string $userId, ?Options $options = null): Op } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -689,9 +602,9 @@ public function deleteProfileImage(string $userId, ?Options $options = null): Op } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -732,11 +645,11 @@ public function disableMFA(string $userId, ?Options $options = null): Operations $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -753,7 +666,7 @@ public function disableMFA(string $userId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -764,7 +677,7 @@ public function disableMFA(string $userId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -775,9 +688,9 @@ public function disableMFA(string $userId, ?Options $options = null): Operations } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -821,11 +734,11 @@ public function getOAuthAccessToken(string $userId, string $provider, ?Options $ $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -842,7 +755,7 @@ public function getOAuthAccessToken(string $userId, string $provider, ?Options $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -853,9 +766,9 @@ public function getOAuthAccessToken(string $userId, string $provider, ?Options $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -896,11 +809,11 @@ public function get(string $userId, ?Options $options = null): Operations\GetUse $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -917,7 +830,7 @@ public function get(string $userId, ?Options $options = null): Operations\GetUse } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -928,9 +841,9 @@ public function get(string $userId, ?Options $options = null): Operations\GetUse } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -972,11 +885,11 @@ public function list(?Operations\GetUserListRequest $request = null, ?Options $o $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -993,7 +906,7 @@ public function list(?Operations\GetUserListRequest $request = null, ?Options $o } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1004,9 +917,9 @@ public function list(?Operations\GetUserListRequest $request = null, ?Options $o } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1047,11 +960,11 @@ public function count(?Operations\GetUsersCountRequest $request = null, ?Options $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1068,7 +981,7 @@ public function count(?Operations\GetUsersCountRequest $request = null, ?Options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1079,9 +992,9 @@ public function count(?Operations\GetUsersCountRequest $request = null, ?Options } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1123,11 +1036,11 @@ public function lock(string $userId, ?Options $options = null): Operations\LockU $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1144,7 +1057,7 @@ public function lock(string $userId, ?Options $options = null): Operations\LockU } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1155,9 +1068,9 @@ public function lock(string $userId, ?Options $options = null): Operations\LockU } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1205,11 +1118,11 @@ public function setProfileImage(Operations\SetUserProfileImageRequestBody $reque $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1226,7 +1139,7 @@ public function setProfileImage(Operations\SetUserProfileImageRequestBody $reque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1237,9 +1150,9 @@ public function setProfileImage(Operations\SetUserProfileImageRequestBody $reque } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1280,11 +1193,11 @@ public function unban(string $userId, ?Options $options = null): Operations\Unba $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 402 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['402', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1301,7 +1214,7 @@ public function unban(string $userId, ?Options $options = null): Operations\Unba } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 402) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['402'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1312,9 +1225,9 @@ public function unban(string $userId, ?Options $options = null): Operations\Unba } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1355,11 +1268,11 @@ public function unlock(string $userId, ?Options $options = null): Operations\Unl $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1376,7 +1289,7 @@ public function unlock(string $userId, ?Options $options = null): Operations\Unl } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1387,9 +1300,9 @@ public function unlock(string $userId, ?Options $options = null): Operations\Unl } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1448,11 +1361,11 @@ public function update(Operations\UpdateUserRequestBody $requestBody, string $us $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1469,7 +1382,7 @@ public function update(Operations\UpdateUserRequestBody $requestBody, string $us } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1480,9 +1393,9 @@ public function update(Operations\UpdateUserRequestBody $requestBody, string $us } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1536,11 +1449,11 @@ public function updateMetadata(string $userId, ?Operations\UpdateUserMetadataReq $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1557,7 +1470,7 @@ public function updateMetadata(string $userId, ?Operations\UpdateUserMetadataReq } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 401, 404, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '404', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1568,9 +1481,9 @@ public function updateMetadata(string $userId, ?Operations\UpdateUserMetadataReq } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1613,11 +1526,11 @@ public function deletePasskey(string $userId, string $passkeyIdentificationId, ? $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1634,7 +1547,7 @@ public function deletePasskey(string $userId, string $passkeyIdentificationId, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1645,7 +1558,7 @@ public function deletePasskey(string $userId, string $passkeyIdentificationId, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1656,9 +1569,9 @@ public function deletePasskey(string $userId, string $passkeyIdentificationId, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1701,11 +1614,11 @@ public function deleteWeb3Wallet(string $userId, string $web3WalletIdentificatio $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1722,7 +1635,7 @@ public function deleteWeb3Wallet(string $userId, string $web3WalletIdentificatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1733,7 +1646,7 @@ public function deleteWeb3Wallet(string $userId, string $web3WalletIdentificatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1744,9 +1657,9 @@ public function deleteWeb3Wallet(string $userId, string $web3WalletIdentificatio } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1796,11 +1709,11 @@ public function getOrganizationInvitations(string $userId, ?int $limit = null, ? $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 403 || $statusCode == 404 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1817,7 +1730,7 @@ public function getOrganizationInvitations(string $userId, ?int $limit = null, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 403, 404])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1828,9 +1741,9 @@ public function getOrganizationInvitations(string $userId, ?int $limit = null, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1878,11 +1791,11 @@ public function getOrganizationMemberships(string $userId, ?int $limit = null, ? $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1899,7 +1812,7 @@ public function getOrganizationMemberships(string $userId, ?int $limit = null, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1910,9 +1823,9 @@ public function getOrganizationMemberships(string $userId, ?int $limit = null, ? } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -1960,11 +1873,11 @@ public function verifyPassword(string $userId, ?Operations\VerifyPasswordRequest $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1981,9 +1894,7 @@ public function verifyPassword(string $userId, ?Operations\VerifyPasswordRequest } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500) { - throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1994,7 +1905,9 @@ public function verifyPassword(string $userId, ?Operations\VerifyPasswordRequest } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX'])) { + throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -2044,11 +1957,11 @@ public function verifyTOTP(string $userId, ?Operations\VerifyTOTPRequestBody $re $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode == 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX', '500', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -2065,9 +1978,7 @@ public function verifyTOTP(string $userId, ?Operations\VerifyTOTPRequestBody $re } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 400 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500) { - throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode == 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -2078,7 +1989,9 @@ public function verifyTOTP(string $userId, ?Operations\VerifyTOTPRequestBody $re } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '422', '4XX'])) { + throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Utils/UnionHandler.php b/src/Utils/UnionHandler.php index a0a941a..5f4f029 100644 --- a/src/Utils/UnionHandler.php +++ b/src/Utils/UnionHandler.php @@ -72,26 +72,11 @@ public function serializeUnion( if ($this->isPrimitiveType(gettype($data))) { return $this->matchSimpleType($data, $type, $context); } else { - if (is_array($data)) { - if (array_is_list($data) && ! empty($data)) { - $innerType = gettype($data[0]); - if ($innerType === 'object') { - $innerType = get_class($data[0]); - } - $resolvedType = [ - 'name' => 'array', - 'params' => ['name' => $innerType, 'params' => []], - ]; + if (is_array($data) && ! empty($data)) { + if (array_is_list($data)) { + return $this->matchArrayType($data, $type, $context); } else { - $keyType = gettype(array_key_first($data)); - $valueType = gettype($data[array_key_first($data)]); - $resolvedType = [ - 'name' => 'array', - 'params' => [ - ['name' => $keyType, 'params' => []], - ['name' => $valueType, 'params' => []], - ], - ]; + return $this->matchAssociativeArrayType($data, $type, $context); } } else { $resolvedType = null; @@ -112,7 +97,6 @@ public function serializeUnion( return $context->getNavigator()->accept($data, $resolvedType); } } - /** * @param DeserializationVisitorInterface $visitor * @param mixed $data @@ -152,8 +136,7 @@ public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed $typeToTry = $possibleType['name']; if ($typeToTry === 'array') { - $typeNames = array_map(fn ($t) => $t['name'], $possibleType['params']); - $typeToTry = 'array<'.implode(', ', $typeNames).'>'; + $typeToTry = $this->resolveArrayTypes($possibleType); } if ($typeToTry === 'enum') { $typeToTry = $possibleType['params'][0]['name']; @@ -235,6 +218,85 @@ private function matchSimpleType(mixed $data, array $type, Context $context): mi return null; } + /** + * @param mixed $data + * @param array $type + * @param Context $context + */ + private function matchArrayType(mixed $data, array $type, Context $context): mixed + { + $dataType = gettype($data[0]); + if ($dataType === 'object') { + $dataType = get_class($data[0]); + } + + foreach ($type['params'] as $possibleType) { + $isNotArray = $possibleType['name'] != 'array'; + $isNotListArray = $possibleType['name'] == 'array' && count($possibleType['params']) > 1 && $possibleType['params'][0]['name'] != 'integer'; + + if ($isNotArray || $isNotListArray) { + continue; + } else { + if (count($possibleType['params']) == 2) { + $possibleValueType = $possibleType['params'][1]['name']; + } else { + $possibleValueType = $possibleType['params'][0]['name']; + } + + if ($possibleValueType == 'mixed' || $possibleValueType == $dataType) { + return $context->getNavigator()->accept($data, $possibleType); + } + } + } + + $resolvedType = [ + 'name' => 'array', + 'params' => ['name' => $dataType, 'params' => []], + ]; + + return $context->getNavigator()->accept($data, $resolvedType); + } + + /** + * @param mixed $data + * @param array $type + * @param Context $context + */ + private function matchAssociativeArrayType(mixed $data, array $type, Context $context): mixed + { + $keyType = gettype(array_key_first($data)); + $value = $data[array_key_first($data)]; + $valueType = gettype($value); + foreach ($type['params'] as $possibleType) { + $isNotArray = $possibleType['name'] != 'array'; + $isNotAssociativeArray = $possibleType['name'] == 'array' && (count($possibleType['params']) < 2 || $possibleType['params'][0]['name'] != 'string'); + + if ($isNotArray || $isNotAssociativeArray) { + continue; + } else { + $possibleValueType = $possibleType['params'][1]['name']; + + if ($valueType == 'object') { + $valueType = get_class($value); + } + + if ($possibleValueType == 'mixed' || $possibleValueType == $valueType) { + return $context->getNavigator()->accept($data, $possibleType); + } + } + } + + $resolvedType = [ + 'name' => 'array', + 'params' => [ + ['name' => $keyType, 'params' => []], + ['name' => $valueType, 'params' => []], + ], + ]; + + return $context->getNavigator()->accept($data, $resolvedType); + } + /** * @param string $type * @return bool @@ -315,4 +377,26 @@ private function reorderTypes(array $type): array return $type; } + + + /** + * @param array $possibleType + * @return string + */ + private function resolveArrayTypes(array $possibleType): string + { + $typeNames = []; + foreach ($possibleType['params'] as $param) { + + if ($param['name'] === 'union') { + $innerTypes = array_map(fn ($t) => $t['name'], $param['params']); + $typeNames[] = $typeToTry = implode('|', $innerTypes); + } else { + $typeNames[] = $param['name']; + } + } + $typeToTry = 'array<'.implode(', ', $typeNames).'>'; + + return $typeToTry; + } } diff --git a/src/Utils/Utils.php b/src/Utils/Utils.php index 7c8a168..6712638 100644 --- a/src/Utils/Utils.php +++ b/src/Utils/Utils.php @@ -356,6 +356,33 @@ public static function urljoin(string $base, string $rel): string return $ret; } + /** + * matchStatusCodes + * + * @param int $statusCode + * @param array $statusCodes + * @return bool + */ + public static function matchStatusCodes(int $statusCode, array $statusCodes): bool + { + $statusCode = (string) $statusCode; + if (in_array('default', $statusCodes)) { + return true; + } + + foreach ($statusCodes as $code) { + if ($code == $statusCode) { + return true; + } + + if (substr($code, -2) === 'XX' && substr($code, 0, 1) === substr($statusCode, 0, 1)) { + return true; + } + } + + return false; + } + } function removePrefix(string $text, string $prefix): string diff --git a/src/WaitlistEntries.php b/src/WaitlistEntries.php index f0d0da0..f8d699e 100644 --- a/src/WaitlistEntries.php +++ b/src/WaitlistEntries.php @@ -80,11 +80,11 @@ public function createWaitlistEntry(?Operations\CreateWaitlistEntryRequestBody $ $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -101,7 +101,7 @@ public function createWaitlistEntry(?Operations\CreateWaitlistEntryRequestBody $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (in_array($statusCode, [400, 422])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -112,9 +112,9 @@ public function createWaitlistEntry(?Operations\CreateWaitlistEntryRequestBody $ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -157,11 +157,11 @@ public function listWaitlistEntries(?Operations\ListWaitlistEntriesRequest $requ $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -178,9 +178,9 @@ public function listWaitlistEntries(?Operations\ListWaitlistEntriesRequest $requ } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Webhooks.php b/src/Webhooks.php index 2b0433a..0d8ec6e 100644 --- a/src/Webhooks.php +++ b/src/Webhooks.php @@ -74,11 +74,11 @@ public function createSvixApp(?Options $options = null): Operations\CreateSvixAp $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -95,7 +95,7 @@ public function createSvixApp(?Options $options = null): Operations\CreateSvixAp } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 400) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -106,9 +106,9 @@ public function createSvixApp(?Options $options = null): Operations\CreateSvixAp } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -145,11 +145,11 @@ public function deleteSvixApp(?Options $options = null): Operations\DeleteSvixAp $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\DeleteSvixAppResponse( @@ -157,7 +157,7 @@ public function deleteSvixApp(?Options $options = null): Operations\DeleteSvixAp contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 400) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -168,9 +168,9 @@ public function deleteSvixApp(?Options $options = null): Operations\DeleteSvixAp } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -207,11 +207,11 @@ public function generateSvixAuthURL(?Options $options = null): Operations\Genera $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -228,7 +228,7 @@ public function generateSvixAuthURL(?Options $options = null): Operations\Genera } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 400) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -239,9 +239,9 @@ public function generateSvixAuthURL(?Options $options = null): Operations\Genera } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Clerk\Backend\Models\Errors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Clerk\Backend\Models\Errors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);